Q. What will be the output of the following
Python code?
for i in range(int(2.0)):
print(i)

  • (A) 0.0 1.0
  • (B) 0 1
  • (C) error
  • (D) none of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (A) 0.0 1.0
Explanation: range(int(2.0)) is the same as range(2).

Explanation by: Mr. Dubey
range(int(2.0)) is the same as range(2).

πŸ’¬ Discussion

πŸ“Š Question Analytics

πŸ‘οΈ
415
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
90%
Success Rate