A

Admin • 833.24K Points
Coach

Q. What will be the output of the following code snippet?

Code:
numbers = (4, 7, 19, 2, 89, 45, 72, 22)
sorted_numbers = sorted(numbers)
odd_numbers = [x for x in sorted_numbers if x % 2 != 0]
print(odd_numbers)
  • (A) [7, 19, 45, 89]
  • (B) [2, 4, 22, 72]
  • (C) [4, 7, 19, 2, 89, 45,72, 22]
  • (D) [2, 4, 7, 19, 22, 45, 72, 89]
  • Correct Answer - Option(A)
  • Views: 42
  • Filed under category Python
  • Hashtags:

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.