-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython_exercise_page78.py
More file actions
60 lines (41 loc) · 1.31 KB
/
python_exercise_page78.py
File metadata and controls
60 lines (41 loc) · 1.31 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
# esercizio numero 5.2 pagina 78
car = 'audi'
print(car == 'Audi')
car = 'maserati'
print(car == 'maserati')
car = 'Audi'
print(car.lower() == 'audi')
lorenzo = 'software developer'
print(lorenzo == 'software developer')
lorenzo = 'Software developer'
print(lorenzo == 'software developer')
print(lorenzo.lower() == 'software developer')
requested_fruits = 'pineapple'
if requested_fruits != 'ananas':
print('Hold the ananas!')
age = 23
if age != 22:
print('you are too young to do this! try again one year later.')
number = 15
if number >= 14:
print(' you won!')
if number <= 14:
print('you lost! try again.')
if number >= 31 and number <=35:
print('you are a genius!')
number_0 = 14
number_1 = 33
print(number_0 >= 13 and number_1 <= 33)
age_0 = 23
age_1 = 45
print(age_0 >= 21 or age_1 <= 45)
age_2 = 34
age_3 = 76
print(age_2 <= 21 or age_3 >= 77)
name_of_people_in_party = ('giovanna', 'luciano', 'andrea', 'luca', 'elisa', 'giacomo')
print('antonio' in name_of_people_in_party)
print('giovanna' in name_of_people_in_party)
banned_people_from_party = ('filippo', 'lorenzo', 'stefano', 'lucia', 'marco', 'michele')
person = 'maria'
if person not in banned_people_from_party:
print(f"{person.title()}, you are welcome at the party!")