forked from aiti-ghana-2012/Lab_Python_02
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUsingControlStructures.py
55 lines (51 loc) · 1.25 KB
/
UsingControlStructures.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
53
54
55
#Q5
print""
theInput = raw_input("Enter an integer: ")
#Your code here
theInput = int(theInput)
if theInput%2 == 0:
print "even"
else:
print "odd"
print"--------------------------------------------------------------------------"
#Q6
print""
primaryschool_age=6
voting_age=18
presidential_age=40
retirement_age=60
personAge = input ("Enter an age:")
if personAge<primaryschool_age:
print "too young"
elif personAge>=voting_age:
print"Remember to vote"
if personAge<presidential_age:
print "you cant be president"
elif personAge>=presidential_age:
print "Vote for me"
if personAge>=retirement_age:
print "too old"
print"----------------------------------------------------------------------------------------------------------------"
#Q7
print""
i=40
while i>0:
if i%3==0:
print i
i=i-1
print"---------------------------------------------------------------------------------------------------"
#Q8
print""
i=0
for i in range(6,30):
if i%2!=0 and i%3!=0 and i%5!=0:
print i
print"---------------------------------------------------------------------------------------------------------------------"
#Q9
print""
n=1
while n>0:
if(79*n)%97==1:
print n
break
n=n+1