- 1
What is the sum of numbers printed by this code? (Kindly explain the answer)
for i in range(10): try: if 10 / i == 2.0: break except ZeroDivisionError: print(1) else: print(2)
11 Answers
+ 2
It's sum of all printing numbers. The printing values are
1,2,2,2,2 = 9
+ 2
La respuesta es : 4
+ 2
What is sum of the numbers printed by this code?
for i in range(10):
try:
if 10 / i == 2.0:
break
except ZeroDivisionError:
print(1)
else:
print(2)
Answer :- 9
0
Try this on sololearn code playground and analyze the output.
0
9
0
for i in range(10):
try:
if 10 / i == 2.0:
break
except ZeroDivisionError:
print(1)
else:
print(2)
ans is : 9
follow me for more answer
0
9
0
9
0
answer is 9
- 1
4
- 1
What is sum of the numbers printed by this code?
for i in range(10):
try:
if 10 / i == 2.0:
break
except ZeroDivisionError:
print(1)
else:
print(2)
A. 9