Predict output, for a in range(1,10,2): print(a) *
1,3 upto 10
0,2 upto 10
1,3 upto 9
0,2 upto 9
Answers
Answered by
6
1,3 upto 9
pls mark as brainlist...
Answered by
3
1,3 upto 9 (Option C)
Explanation:
- for loop is a type of loop available in python.
- A for loop is mainly used to iterate a sequence.
- It is used to iterate over a list, tuple and strings.
- Iterating over a sequence is also called as traversal.
- Syntax: for variable in sequence:
Program:
for a in range(1,10,2):
# In this for loop, a is the variable, 1 is the initialization, 10 is the range and 2 is the increment by value.
print(a)
# So, it prints 1 and increments by 2 and then prints 3 and so on....
Refer the attached image for the output.
Therefore, option C is correct.
Attachments:
Similar questions