-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEx 7.py
More file actions
98 lines (79 loc) · 2.77 KB
/
Copy pathEx 7.py
File metadata and controls
98 lines (79 loc) · 2.77 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#%%
print('___________ Ex 7 _______(part 012)________\n ')
x1=int(input("lotfan adade aval ra vared konid"))
x2=int(input("lotfan adade dovom ra vared konid"))
if x1<x2:
print (x1,',',x2)
else:
print(x2,',',x1)
#____________________________________________________________________________
#%%
print('___________ Ex 7 _______(part 013)________\n ')
x1=int(input("lotfan yek adad kamtar az 20 vared konid"))
while x1>=20:
print('Too high')
x1=int(input("lotfan yek adad kamtar az 20 vared konid"))
print(" thank you :) ")
#____________________________________________________________________________
#%%
print('___________ Ex 7 _______(part 014)________\n ')
x1=int(input("lotfan yek adad dar baze 10 ta 20 vared konid"))
while x1>20 or x1<10:
print('Incorrect answer')
x1=int(input("lotfan yek adad dar baze 10 ta 20 vared konid"))
print(" thank you :) ")
#____________________________________________________________________________
#%%
print('___________ Ex 7 _______(part 015)________\n ')
str1 = input ("Insert your favorite color: ")
if str1 == "red" or str1=="Red" or str1=="RED":
print ("I like " + str1 + " too")
else:
print ("I don't like " + str1 + " , I prefer red")
#____________________________________________________________________________
#%%
print('___________ Ex 7 _______(part 016)________\n ')
str1= str (input ("Is it raining? "))
if str1 == "yes" or str1 == "YES":
str2= str (input ("Is it windy? "))
if str2== "yes"or str1 == "YES":
print ("It is too windy for an umbrella")
else:
print ("take an umbrella")
else:
print ("Enjoy your day")
#____________________________________________________________________________
#%%
print('___________ Ex 7 _______(part 017)________\n ')
x = int (input (" please insert your age: "))
if x > 18 or x == 18:
print ("You can vote")
elif x == 17:
print ("You can learn to drive")
elif x == 16:
print ("You can buy a lottery ticket")
else:
print ("You can go Trick-or-Treating")
#____________________________________________________________________________
#%%
print('___________ Ex 7 _______(part 018)________\n ')
x = int (input ( "insert a number: "))
if x < 10:
print ("Too low")
elif x > 9 and x <20:
print ("correct")
else:
print ("Too high")
#____________________________________________________________________________
# %%
print('___________ Ex 7 _______(part 019)________\n ')
x = int (input ("insert 1 or 2 or 3: "))
if x== 1:
print ("Thank you")
elif x==2:
print ("well done")
elif x==3:
print ("correct")
else:
print ("Error message")
print('___________ Fatemeh Rabie ___________ ')