-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpython_intro.py
56 lines (44 loc) · 1.01 KB
/
python_intro.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
56
print('Hello, Django girls!')
if 3 > 2:
print('It works!')
if 5 > 2:
print('5 is indeed greater than 2')
else:
print('5 is not greater than 2')
name = 'Sonja'
if name == 'Ola':
print('Hey Ola!')
elif name == 'Sonja':
print('Hey Sonja!')
else:
print('Hey anonymous!')
volume = 57
if volume < 20:
print("It's kinda quiet.")
elif 20 <= volume < 40:
print("It's nice for background music")
elif 40 <= volume < 60:
print("Perfect, I can hear all the details")
elif 60 <= volume < 80:
print("Nice for parties")
elif 80 <= volume < 100:
print("A bit loud!")
else:
print("My ears are hurting! :(")
if volume < 20 or volume > 80:
volume = 50
print("That's better!")
def hi(name):
if name == 'Ola':
print('Hi Ola!')
elif name == 'Sonja':
print('Hi Sonja!')
else:
print('Hi ' + name + '!')
hi('Lisa')
girls = ['Rachel', 'Monica', 'Phoebe', 'Ola', 'Lisa']
for name in girls:
hi(name)
print('Next girl')
for i in range(1, 6):
print(i)