Given a list of numbers, write a Python program to print all negative numbers in given list.
Input: list1 = [12, -7, 5, 64, -14] Output: -7, -14 Input: list2 = [12, 14, -95, 3] Output: -95
Example #1: Print all negative numbers from given list using for loop
Iterate each element in the list using for loop and check if number is less than 0. If the condition satisfies, then only print the number.
Example #2: Using while loop
-10 -4 -45 -66
Example #3: Using list comprehension
Negative numbers in the list: -10 -21 -4 -66
Example #4: Using lambda expressions
Negative numbers in the list: -10 -45 -66 -11
- Python program to print all negative numbers in a range
- Python program to count positive and negative 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
- Python | Counting sign change in list containing Positive and Negative Integers
- Python - Remove Negative Elements in List
- Python - Negative index of Element in List
- 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 odd numbers in a List
- Python program to print even numbers in a list
- Python program to print positive numbers in a list
- Python program to print all Strong numbers in given list
- Count Negative Numbers in a Column-Wise and Row-Wise Sorted Matrix
- 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
- numpy.negative() in Python
- Python | Filter the negative values from given dictionary
- Negative transformation of an image using Python and OpenCV
- Python | Replace negative value with zero in numpy array
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. 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.