Informatics Practices
Which statement is used to iterate itself over a range of values or a sequence?
- if
- while
- do-while
- for
Python Control Flow
1 Like
Answer
for
Reason — The for loop statement is used to iterate/repeat itself over a range of values or a sequence.
Answered By
3 Likes
Related Questions
Which of the following is not a loop statement in Python?
- do-while
- while
- for
- All of these
What will be the output?
x = ['ab', 'cd'] for i in x: i.upper() print (x)- ['ab', 'cd']
- ['AB', 'CD']
- [None, None]
- None of these
Find the output of the following Python program:
for x in range(1, 20, 3): print(x, end =',')- 1,20,3,
- 1,4,7,10,13,16,19,
- 13,6,9,12,15,18,
- 20,40,60,80,100,
if statement comes in which category of statements?
- Sequential statements
- Conditional statements.
- Iterative statements
- Loop statement