Predict the output.
a) L = [1,2,3,4,5]
for i in L:
print(i)
1
b) for i in range(20,30,2):
print(i)
Answers
Answered by
0
sorry! I don't answer!!!!!!!!!!!!!
Answered by
1
Program (a) :
L = [1 , 2 , 3 , 4 , 5]
for i in L:
print(i)
Output :
1
2
3
4
5
Explanation :
i will take all the elements in L one by one and print it on the screen.
Program (b) :
for i in range(20 , 30 , 2):
print(i)
Output :
20
22
24
26
28
Explanation :
Loop will start from 20 and will go till 30
i will take the all even numbers between 20 and 30.
Similar questions