8.3k views
1 vote
Can you say if each statement is true or false

2. Counter statements like sum += 1 are often used in the body of for loops.
3. A for loop with the header for i in range(1, 5): would iterate exactly 5 times.
4. A for loop with the header for i in range(4, 10, 2): would iterate exactly 6 times.
5. The for loop with the header for i in range(4): would iterate exactly 4 times.
6. The statement sum += 1 is equivalent to the statement sum = sum + 1 True
7. A good name for a for loop's control (or loop) variable would be z.
8. A for loop is considered to be a definite loop.
9. A while loop is considered to be an indefinite loop.

User BTables
by
3.9k points

1 Answer

4 votes

The Answer Is

2.True

3.false

4.true

5.true

6.true

7.false

8.false

9.true

Expilnation

Its what I think

User Donghui Zhang
by
3.8k points