forked from aiti-ghana-2012/Lab_Python_02
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ControlStructures.py~
57 lines (34 loc) · 1.16 KB
/
ControlStructures.py~
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
theInput = input("Enter an integer: ")
if theInput%2 == 0:
print 'even'
elif theInput%2 == 1:
print 'odd'
print'-------------------------------------------------------------------------------'
primarySchAge =4
legalVotingAge=18
ageAsPresident=40
officialRetirmentAge=60
personsAge = input('Enger an age: ')
if personsAge<primarySchAge:
print 'too young.'
elif personsAge>=legalVotingAge:
print 'Remember to vote'
if personsAge>=ageAsPresident:
print 'Vote for me'
elif personsAge<ageAsPresident:
print 'You can’t be president'
elif personsAge>=officialRetirmentAge:
print 'Too old.'
print'-------------------------------------------------------------------------------'
for number in range(40,-1,-1):
if number%3==0:
print number
print'-------------------------------------------------------------------------------'
for number in range (6,31):
if number%2!=0 and number%3!=0 and number%5!=0:
print number
print'-------------------------------------------------------------------------------'
number=1
while(79*number)%97!=1:
number=number+1
print number