Quiz Python 5. Loops

Don't have a Resume?




Question :

Analyze the following statement:

sum = 0
for d in range(0, 10, 0.1):
    sum += sum + d

  1. The program has a syntax error because the range function cannot have three arguments.
  2. The program has a syntax error because the arguments in the range must be integers.
  3. The program runs in an infinite loop.
  4. The program runs fine.
Answer : Option 2