-
Notifications
You must be signed in to change notification settings - Fork 0
/
Task4.py
39 lines (33 loc) · 1.26 KB
/
Task4.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
# TASK4, HOMEWORK ------> ATABEK
# 1)
# menu = {'Lagman': 120, 'Plov': 120, 'Borsh': 100}
# menu['Besh Barmak'] = 180
# menu['Lagman'] = 135
# menu.pop('Borsh',[100])
# print(menu)
# 2)
# baby = {'Hello': 'Hi', 'Good': 'Nice', 'Price': 'Cost'}
# print(baby.get('Price'))
# 3)
# a)variant
# Countries = ['Russia', 'USA', 'Germany']
# cities = ['Moscow', 'New York', 'Berlin']
# Countries_cities = dict(zip(Countries, cities))
# print(Countries_cities)
# b)variant
# Countries = ['Russia', 'USA', 'Germany']
# cities = ['New York', 'Moscow', 'Berlin']
# line = (Countries[0] + ':' + cities[1])
# d = (Countries[1] + ':' + cities[0])
# g = (Countries[2] + ':' + cities[2])
# print(line+','+' '+d+','+' '+g)
# 4)
# dog = {'name': 'Bobik', 'color': 'black', 'age': '5'}
# cat = {'name': 'Barsik', 'color': 'white', 'age': '9'}
# answer = ('This is a ' + dog['name']+'. '+ 'He is ' + dog['color']+' '+'and'+' '+'he is already '+dog['age']+' ' +'years old.')
# print(answer)
# result = ('This is a ' + cat['name']+'. '+ 'He is ' + cat['color']+' '+'and'+' '+'he is already '+cat['age']+' ' +'years old.')
# print(result)
# 5)
# student = {'1a': ['John', 'Jessica', 'Tom'], '2b': ['Ben', 'Adam', 'Elena']}
# print('This is ' + student['1a'][2] + '.'+ ' '+'He is in grade'+' '+str('1a')+'.')