Python program to print positive numbers in a list Last Updated : 11 Jul, 2025 Comments Improve Suggest changes Like Article Like Report In this article, we will explore various methods to o print positive numbers in a list. The simplest way to do is by using for loop function. Using LoopThe most basic method for printing positive numbers is to use a for loop to iterate through the list and check each element. Python a = [-10, 15, 0, 20, -5, 30, -2] # Using a for loop to print positive number for val in a: if val > 0: print(val) Output15 20 30 Explanation:Iterates over the list numbers.For each number checks if the number is greater than 0 (val > 0).If the condition is true than print the number.Using List ComprehensionList comprehension provides a compact and Pythonic way to filter positive numbers. Python a = [-10, 15, 0, 20, -5, 30, -2] # List comprehension to filter positive numbers res = [i for i in a if i > 0] print(res) Output[15, 20, 30] Using filter() FunctionThe filter() function can be used to filter out positive numbers from the list. Python a = [-10, 15, 0, 20, -5, 30, -2] # Using filter() to get positive numbers res = filter(lambda x: x > 0, a) # Convert filter object to list and print print(list(res)) Output[15, 20, 30] Comment More infoAdvertise with us Next Article Python program to count positive and negative numbers in a list S Shivam_k Follow Improve Article Tags : Python python-list Python list-programs Practice Tags : pythonpython-list Similar Reads Python program to print all positive numbers in a range In this article, we will explore various methods to print all positive numbers in a range. The simplest way to do this is by using a loop. Use a simple for loop to iterate through the given range and check if each number is greater than zero before printing it.Pythonstart = -5 end = 3 # Loop through 2 min read Python program to print all positive numbers in a range In this article, we will explore various methods to print all positive numbers in a range. The simplest way to do this is by using a loop. Use a simple for loop to iterate through the given range and check if each number is greater than zero before printing it.Pythonstart = -5 end = 3 # Loop through 2 min read Python program to print negative numbers in a list In Python, itâs often necessary to find and print negative numbers from a list. In this article we will explore various approches to print negative numbers in a list. The most basic method for printing negative numbers is to use a for loop to iterate through the list and check each element.Pythona = 2 min read Python program to print negative numbers in a list In Python, itâs often necessary to find and print negative numbers from a list. In this article we will explore various approches to print negative numbers in a list. The most basic method for printing negative numbers is to use a for loop to iterate through the list and check each element.Pythona = 2 min read Python program to count positive and negative numbers in a list In this article, we will explore various methods to count positive and negative numbers in a list. The simplest way to do this is by using a loop. This method counts the positive and negative numbers in a list by iterating through each element using for loop.Pythona = [10, -20, 30, -40, 50, -60, 0] 2 min read Python program to count positive and negative numbers in a list In this article, we will explore various methods to count positive and negative numbers in a list. The simplest way to do this is by using a loop. This method counts the positive and negative numbers in a list by iterating through each element using for loop.Pythona = [10, -20, 30, -40, 50, -60, 0] 2 min read Like