We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0ef5986 commit 4f7ea8aCopy full SHA for 4f7ea8a
data_sci_from_scratch/1.py
@@ -0,0 +1,30 @@
1
+users = [
2
+ {"id": 0, "name": "Hero"},
3
+ {"id": 1, "name": "Dunn"},
4
+ {"id": 2, "name": "Sue"},
5
+ {"id": 3, "name": "Chi"},
6
+ {"id": 4, "name": "Thor"},
7
+ {"id": 5, "name": "Clive"},
8
+ {"id": 6, "name": "Hicks"},
9
+ {"id": 7, "name": "Devin"},
10
+ {"id": 8, "name": "Kate"},
11
+ {"id": 9, "name": "Klein"}
12
+]
13
+# дружеские отношения пользователей
14
+friendship_pairs = [(0, 1), (0, 2), (1, 2), (1, 3), (2, 3), (3, 4),
15
+ (4, 5), (5, 6), (5, 7), (6, 8), (7, 8), (8, 9)]
16
+# списки друзей пользователей
17
+# for user in users:
18
+# user["friends"] = []
19
+
20
+friendships = {user["id"]: [] for user in users}
21
22
+#print(*users)
23
24
25
+#заполняем друзей
26
+for i, j in friendship_pairs:
27
+ friendships[i].append(j) # Add j as a friend of user i
28
+ friendships[j].append(i) # Add i as a friend of user j
29
30
+# print(friendships)
hw1/100A
@@ -1 +1 @@
-print(100 * "A")
+print(200 * "A")
0 commit comments