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
48 lines (40 loc) · 920 Bytes
/
Copy pathusingControlstructures.py
File metadata and controls
48 lines (40 loc) · 920 Bytes
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
#ex5
theInput=raw_input("Enter an integer then press 'enter': ")
i=int(theInput)
if i%2==0:
print"this is an even number"
else:
print"this is odd"
#ex6
school_age=5
voting_age=18
retiring_age=60
presidential_age=40
personsAge=input('enter your age and press enter')
j=personsAge
if j< school_age and j>0:
print"you are too young"
if j>=voting_age:
print"remember to vote on 7th december"
if j>=presidential_age and j>= voting_age and j>0:
print"vote for me"
elif j< presidential_age and j>0:
print'you cant be president'
if j>= retiring_age:
print'you are too old'
elif j<0:
print"i dont know where you fit"
#ex7
for i in range(40,-1,-1):
if i%3==0:
print i
#ex8
for k in range(6,31,1):
if (k%2!=0) and (k%3!=0) and (k%5!=0):
print k
#ex9
n=0
for n in range(0,100,1):
while (n*79)%97==1:
print n
n= n+1