Question #60

How many times is "I love Python" going to be printed?
for i in range(0,10):
    print("I love Python!")

10 times! The syntax of the range function is range(start, stop, step) . In that case range() will start at (before) 0 and stop at (before) 10: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. 10 times! (w3schools.com/python/ref_func_range.asp)


Comment on Disqus:

Comment on Twitter:

Question difficulty: 🔵🔵🔵🔵🔵


Similar questions: