#for loops
sum=0
for i in range(10) :
sum=sum+i
print(sum)
# while loops is equal to for loops
sum=0
i=o
while i<10:
sum=sum+i
print(sum)
i=i+1
#for loops
sum=0
for i in range(10) :
sum=sum+i
print(sum)
# while loops is equal to for loops
sum=0
i=o
while i<10:
sum=sum+i
print(sum)
i=i+1
本文标题:python unit 3 for loops and whil
本文链接:https://www.haomeiwen.com/subject/ecvliftx.html
网友评论