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
57 lines (45 loc) · 1.04 KB
/
Copy pathUsingControlStructures.py.~
File metadata and controls
57 lines (45 loc) · 1.04 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
57
part ii
ques 5.
theInput = raw_input("Enter an integer: ")
#
theInput = int(theInput)
if (theInput % 2 == 0):
print"even"
else:
print"odd"
print"................................"
6. personsAge = input(“Enter an age:")
people_startprimary_school= 5
legal_voting_age = 18
age_can_be_president = 45
official_retirement_age= 60
personsAge = raw_input("Enter an age:")
personsAge= int(personsAge)
if personsAge<(people_startprimary_school):
print"too young"
elif personsAge>=(legal_voting_age):
print"remember to vote"
elif personsAge>=(official_retirement_age):
print"too old"
elif personsAge>=(age_can_be_president):
print"vote for me"
else:
if personsAge<=(age_can_be_president):
print"you can't be president"
7.i=40
while i>0:
if i%3==0:
print i,
i=i-1
8.for i in range(6,30):
if (i %2!=0):
if(1%3!=0):
if(i%5!=0):
print i, " , "
9.n=1
while(n):
a=79*n
if(a%97==1):
print"the smallest positive integer n such that 79*n:",n
break
n=n+1