Friday, June 28, 2019

for and else loops in python

for n in [10 ,9 ,8 ,7 ,6 ,5 ,4 ,3 ,2 ,1]:
    print (n)
else:
    print(" blastoff")

output:
10
9
8
7
6
5
4
3
2
1
 blastoff

No comments:

Post a Comment

python class topic video