Challenge: Separating Positive and Negative Numbers from a List

Write code to create two lists using a list that has positive and negative numbers.

Suppose a list contains both positive and negative numbers. Write a program to create two lists—one containing positive numbers and another containing negative numbers:

  • Input: A list contains positive and negative numbers.
  • Output: The original list, positive numbers list, and negative numbers list will be printed on the console.

Get hands-on with 1400+ tech skills courses.