In python,What is the output of the following code snippet? a=5 for i in range(10) a=a+1
Answers
Answered by
0
Answer:
a =16
Explanation:
It will add 1to a Everytime I is Incremented till I=10
Answered by
0
Answer:
a = 15
Explanation:
a = 5 # value of a is 5
for i in range(10): # for i in range 0 to 9
a = a + 1 # so for i = 0, a = 6; for i = 1, a = 7; for i = 2, a = 8; for i = 3, a = 8; ... and for i = 9, a = 15
print(a) #gives the output as 15
Similar questions