Given start and end of a range, write a Python program to print all negative numbers in given range.
Input: start = -4, end = 5 Output: -4, -3, -2, -1 Input: start = -3, end = 4 Output: -3, -2, -1
Example #1: Print all negative numbers from given list using for loop
Define start and end limit of range. Iterate from start till the range in the list using for loop and check if num is less than 0. If the condition satisfies, then only print the number.
-4, -3, -2, -1
Example #2: Taking range limit from user input
Enter the start of range: -15 Enter the end of range: 5 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.
- Python program to print negative numbers in a list
- Python program to print all even numbers in a range
- Python program to print all odd numbers in a range
- Python program to print all positive numbers in a range
- Python program to count positive and negative numbers in a list
- Python Program to find Sum of Negative, Positive Even and Positive Odd numbers in a List
- Find ratio of zeroes, positive numbers and negative numbers in the Array
- C program to count Positive and Negative numbers in an Array
- Print all numbers in given range having digits in strictly increasing order
- Lambda expression in Python to rearrange positive and negative numbers
- Python Program to Check Whether a Number is Positive or Negative or zero
- Python program to print all Prime numbers in an Interval
- Python program to print all Strong numbers in given list
- Count Negative Numbers in a Column-Wise and Row-Wise Sorted Matrix
- Python Program for Efficient program to print all prime factors of a given number
- How to compute numerical negative value for all elements in a given NumPy array?
- Program to check if a number is Positive, Negative, Odd, Even, Zero
- C program to Check Whether a Number is Positive or Negative or Zero
- Program to print all the numbers divisible by 3 and 5 for a given number
- Program to print all the numbers divisible by 5 or 7 for a given number
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.