πŸ“Š Python
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]
πŸ’¬ Discuss
βœ… Correct Answer: (A) [7, 19, 45, 89]

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
1249
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Akash Lawaniya
Publisher
πŸ“ˆ
85%
Success Rate