-
Notifications
You must be signed in to change notification settings - Fork 0
/
06.02.py
executable file
·37 lines (36 loc) · 1.18 KB
/
06.02.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
#6.2
#favorite numbers
#favorite_numbers = {
# 'sergey': 56,
# 'dimitriy': 24,
# 'damir': 94,
# 'rinat': 27,
# 'ilya': 44
#}
# creating ppl's list
favorite_ppl = []
favorite_ppl.append('sergey')
favorite_ppl.append('dimitriy')
favorite_ppl.append('damir')
favorite_ppl.append('rinat')
favorite_ppl.append('ilya')
#checkingf the list code
#print(favorite_ppl)
#creating the dictionary which is linked to list
favorite_numbers = {}
favorite_numbers[favorite_ppl[0]] = 56
favorite_numbers[favorite_ppl[1]] = 24
favorite_numbers[favorite_ppl[2]] = 94
favorite_numbers[favorite_ppl[3]] = 27
favorite_numbers[favorite_ppl[4]] = 44
#creating message outputs
smesg = f"{favorite_ppl[0].title()}'s favorite number is: {favorite_numbers[favorite_ppl[0]]}."
print(smesg)
smesg = f"{favorite_ppl[1].title()}'s favorite number is: {favorite_numbers[favorite_ppl[1]]}."
print(smesg)
smesg = f"{favorite_ppl[2].title()}'s favorite number is: {favorite_numbers[favorite_ppl[2]]}."
print(smesg)
smesg = f"{favorite_ppl[3].title()}'s favorite number is: {favorite_numbers[favorite_ppl[3]]}."
print(smesg)
smesg = f"{favorite_ppl[4].title()}'s favorite number is: {favorite_numbers[favorite_ppl[4]]}."
print(smesg)