Skip to content

Instantly share code, notes, and snippets.

@MahraibFatima
Created March 19, 2024 16:05
Show Gist options
  • Save MahraibFatima/5ef4c45ea5743234c0910f85d565545f to your computer and use it in GitHub Desktop.
Save MahraibFatima/5ef4c45ea5743234c0910f85d565545f to your computer and use it in GitHub Desktop.
List containing only the positive numbers from the original list.
numbers = [-2, -1, 0, 1, 2, 3]
positive_numbers = [num for num in numbers if num >= 0]
print("Positive Numbers:", positive_numbers)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment