19. Problem to remove negative elements from the list

We will take a user input as a list & iterate all the values one by one with the python loop to remove negative elements from it. Print only positive values with the help of the below-given steps.

Remove negative elements from list:

Steps to solve the program
  1. Take a list as input.
  2. Using for loop and if statement check whether an element from the given list is negative or positive.
  3. Print only positive elements.

Output :

Related Articles

removing certain elements a list

List of elements divided by a number

Leave a Comment