Python 10 Programming Tutorial - 10 - comments and break

magicNumber = 26

for n in range(101):
    if n is magicNumber:
        print(n, " is the magic number!")
        break
    else:
        print(n)

'''
*** Challenge 1 ***
Create a program that lists all the numbers between 1-100 that are divisible by four.
Good luck!
'''

你可能感兴趣的:(Python 10 Programming Tutorial - 10 - comments and break)