|
@@ -1,21 +1,21 @@
|
|
|
|
|
|
-a = [42, 23, 66, 42, 93, 47, 30]
|
|
|
-b = 'dsf aaerwq dfasdf '
|
|
|
-c = ('sdf', 'sdqwet', 'ghetrertg')
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
-new_list = a
|
|
|
-new_list = new_list.sort()
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-sorted(a)
|
|
|
+
|
|
|
|
|
|
|
|
|
-sorted_string = sorted(b, reverse=True)
|
|
|
-sorted_tuple = sorted(c)
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -23,13 +23,13 @@ sorted_tuple = sorted(c)
|
|
|
|
|
|
|
|
|
|
|
|
-def foo(x):
|
|
|
- return x%10, x//10%10
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-my_list_1 = ['ZZZ 5', 'aaa 7', 'BBB 23', 'www 45', 'EEE 5', 'ddd 5']
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -39,9 +39,9 @@ my_list_1 = ['ZZZ 5', 'aaa 7', 'BBB 23', 'www 45', 'EEE 5', 'ddd 5']
|
|
|
|
|
|
|
|
|
|
|
|
-subject_marks = [('English', 88), ('Science', 90), ('Maths', 88),
|
|
|
- ('Physics', 93), ('History', 78), ('French', 78),
|
|
|
- ('Art', 78), ('Chemistry', 88), ('Programming', 91)]
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -59,15 +59,15 @@ subject_marks = [('English', 88), ('Science', 90), ('Maths', 88),
|
|
|
|
|
|
|
|
|
|
|
|
-models = [{'make': 'Nokia', 'model': 216, 'color': 'Black'},
|
|
|
- {'make': 'Mi Max', 'model': 2, 'color': 'Gold'},
|
|
|
- {'make': 'Samsung', 'model': 7, 'color': 'Blue'},
|
|
|
- {'make': 'Apple', 'model': 10, 'color': 'Silver'},
|
|
|
- {'make': 'Oppo', 'model': 9, 'color': 'Red'},
|
|
|
- {'make': 'Huawei', 'model': 4, 'color': 'Grey'},
|
|
|
- {'make': 'Honor', 'model': 3, 'color': 'Black'}]
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
-models = sorted(models, key=lambda x: x.get('color'))
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -112,11 +112,41 @@ models = sorted(models, key=lambda x: x.get('color'))
|
|
|
|
|
|
|
|
|
|
|
|
-print(type(input().split()))
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
+def sort_1():
|
|
|
+ fone_book = {}
|
|
|
+ req_list = []
|
|
|
+ rec_cnt = int(input())
|
|
|
+ for i in range(rec_cnt):
|
|
|
+ record = input().split()
|
|
|
+ if record[1] not in fone_book.keys():
|
|
|
+ fone_book[record[1]] = [record[0]]
|
|
|
+ else:
|
|
|
+ tmp = fone_book[record[1]]
|
|
|
+ tmp.append(record[0])
|
|
|
+ fone_book[record[1]] = tmp
|
|
|
+
|
|
|
+ req_cnt = int(input())
|
|
|
+ for i in range(req_cnt):
|
|
|
+ req_list.append(input())
|
|
|
+ for i in req_list:
|
|
|
+ if i in fone_book.keys():
|
|
|
+ print(*fone_book[i])
|
|
|
+ else:
|
|
|
+ print('Неизвестный номер')
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ print(fone_book)
|
|
|
+ print(req_list)
|
|
|
+
|
|
|
+sort_1()
|
|
|
+
|
|
|
+
|
|
|
+
|