Python 3 Comments & Break program assignment

+1 Adrian Correa · February 5, 2015
magicNumber = 26

for n in range(101):
    if n is magicNumber:
        print(n, " is magic number!")
    else:
        x = n % 4
        if x is 0 and n > 0:
            print(n)


4
8
12
16
20
24
26  is magic number!
28
32
36
40
44
48
52
56
60
64
68
72
76
80
84
88
92
96
100

Process finished with exit code 0

Post a Reply

Replies

Oldest  Newest  Rating
0 Diogo Pacheco Pedro · February 6, 2015
I got it !

Thanks for the tutorial man! really enjoying them1
  • 1

Python

106,950 followers
About

This section is all about snakes! Just kidding.

Links
Moderators
Bucky Roberts Administrator