πŸ“Š Python
Q. What is the output of the following program?
Code:
data = [x for x in range(5)]
temp = [x for x in range(7) if x in data and x%2==0]
print(temp)
  • (A) [0, 2, 4, 6]
  • (B) [0, 2, 4]
  • (C) [0, 1, 2, 3, 4, 5]
  • (D) Runtime error
πŸ’¬ Discuss
βœ… Correct Answer: (B) [0, 2, 4]

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
254
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
85%
Success Rate