forked from aiti-ghana-2012/Lab_Python_02
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUsingControlStructures.py
More file actions
82 lines (46 loc) · 1.06 KB
/
UsingControlStructures.py
File metadata and controls
82 lines (46 loc) · 1.06 KB
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
53
54
55
56
theInput = raw_input("Enter an integer: ")
#Your code here
theInput=int(theInput)
if theInput % 2 == 0:
print "even"
else:
print "odd"
print "\n"
print "------------------------------------------------"
print "\n"
primSchAge=6
legalVotnAge=18
presidentAge=40
retireAge=60
personsAge = input('Enter an age: ')
if personsAge < primSchAge:
print 'Too young'
elif personsAge >= legalVotnAge :
print 'Remember to vote'
elif personsAge>=presidentAge:
print 'Vote for me'
elif personsAge < presidentAge:
print "You can't be president"
elif personsAge>=retireAge:
print 'Too old'
print "\n"
print "------------------------------------------------"
print "\n"
i=40
while i>0:
i=i-1
if i%3==0:
print i
print "\n"
print "------------------------------------------------"
print "\n"
for i in range(6,30,1):
if i%2!=0 and i%3!=0 and i%5!=0:
print i
print "\n"
print "------------------------------------------------"
print "\n"
n=1
while (79*n)%97 != 1:
n=n+1
print 'n is= ', n