1
+ import random
2
+
3
+
4
+ logo = """
5
+ __ ___ __
6
+ / / / (_)___ _/ /_ ___ _____
7
+ / /_/ / / __ `/ __ \/ _ \/ ___/
8
+ / __ / / /_/ / / / / __/ /
9
+ /_/ ///_/\__, /_/ /_/\___/_/
10
+ / / /____/_ _____ _____
11
+ / / / __ \ | /| / / _ \/ ___/
12
+ / /___/ /_/ / |/ |/ / __/ /
13
+ /_____/\____/|__/|__/\___/_/
14
+ """
15
+
16
+ vs = """
17
+ _ __
18
+ | | / /____
19
+ | | / / ___/
20
+ | |/ (__ )
21
+ |___/____(_)
22
+ """
23
+
24
+ data = [
25
+ {
26
+ 'name' : 'Instagram' ,
27
+ 'follower_count' : 346 ,
28
+ 'description' : 'Social media platform' ,
29
+ 'country' : 'United States'
30
+ },
31
+ {
32
+ 'name' : 'Cristiano Ronaldo' ,
33
+ 'follower_count' : 215 ,
34
+ 'description' : 'Footballer' ,
35
+ 'country' : 'Portugal'
36
+ },
37
+ {
38
+ 'name' : 'Ariana Grande' ,
39
+ 'follower_count' : 183 ,
40
+ 'description' : 'Musician and actress' ,
41
+ 'country' : 'United States'
42
+ },
43
+ {
44
+ 'name' : 'Dwayne Johnson' ,
45
+ 'follower_count' : 181 ,
46
+ 'description' : 'Actor and professional wrestler' ,
47
+ 'country' : 'United States'
48
+ },
49
+ {
50
+ 'name' : 'Selena Gomez' ,
51
+ 'follower_count' : 174 ,
52
+ 'description' : 'Musician and actress' ,
53
+ 'country' : 'United States'
54
+ },
55
+ {
56
+ 'name' : 'Kylie Jenner' ,
57
+ 'follower_count' : 172 ,
58
+ 'description' : 'Reality TV personality and businesswoman and Self-Made Billionaire' ,
59
+ 'country' : 'United States'
60
+ },
61
+ {
62
+ 'name' : 'Kim Kardashian' ,
63
+ 'follower_count' : 167 ,
64
+ 'description' : 'Reality TV personality and businesswoman' ,
65
+ 'country' : 'United States'
66
+ },
67
+ {
68
+ 'name' : 'Lionel Messi' ,
69
+ 'follower_count' : 149 ,
70
+ 'description' : 'Footballer' ,
71
+ 'country' : 'Argentina'
72
+ },
73
+ {
74
+ 'name' : 'Beyoncé' ,
75
+ 'follower_count' : 145 ,
76
+ 'description' : 'Musician' ,
77
+ 'country' : 'United States'
78
+ },
79
+ {
80
+ 'name' : 'Neymar' ,
81
+ 'follower_count' : 138 ,
82
+ 'description' : 'Footballer' ,
83
+ 'country' : 'Brasil'
84
+ },
85
+ {
86
+ 'name' : 'National Geographic' ,
87
+ 'follower_count' : 135 ,
88
+ 'description' : 'Magazine' ,
89
+ 'country' : 'United States'
90
+ },
91
+ {
92
+ 'name' : 'Justin Bieber' ,
93
+ 'follower_count' : 133 ,
94
+ 'description' : 'Musician' ,
95
+ 'country' : 'Canada'
96
+ },
97
+ {
98
+ 'name' : 'Taylor Swift' ,
99
+ 'follower_count' : 131 ,
100
+ 'description' : 'Musician' ,
101
+ 'country' : 'United States'
102
+ },
103
+ {
104
+ 'name' : 'Kendall Jenner' ,
105
+ 'follower_count' : 127 ,
106
+ 'description' : 'Reality TV personality and Model' ,
107
+ 'country' : 'United States'
108
+ },
109
+ {
110
+ 'name' : 'Jennifer Lopez' ,
111
+ 'follower_count' : 119 ,
112
+ 'description' : 'Musician and actress' ,
113
+ 'country' : 'United States'
114
+ },
115
+ {
116
+ 'name' : 'Nicki Minaj' ,
117
+ 'follower_count' : 113 ,
118
+ 'description' : 'Musician' ,
119
+ 'country' : 'Trinidad and Tobago'
120
+ },
121
+ {
122
+ 'name' : 'Nike' ,
123
+ 'follower_count' : 109 ,
124
+ 'description' : 'Sportswear multinational' ,
125
+ 'country' : 'United States'
126
+ },
127
+ {
128
+ 'name' : 'Khloé Kardashian' ,
129
+ 'follower_count' : 108 ,
130
+ 'description' : 'Reality TV personality and businesswoman' ,
131
+ 'country' : 'United States'
132
+ },
133
+ {
134
+ 'name' : 'Miley Cyrus' ,
135
+ 'follower_count' : 107 ,
136
+ 'description' : 'Musician and actress' ,
137
+ 'country' : 'United States'
138
+ },
139
+ {
140
+ 'name' : 'Katy Perry' ,
141
+ 'follower_count' : 94 ,
142
+ 'description' : 'Musician' ,
143
+ 'country' : 'United States'
144
+ },
145
+ {
146
+ 'name' : 'Kourtney Kardashian' ,
147
+ 'follower_count' : 90 ,
148
+ 'description' : 'Reality TV personality' ,
149
+ 'country' : 'United States'
150
+ },
151
+ {
152
+ 'name' : 'Kevin Hart' ,
153
+ 'follower_count' : 89 ,
154
+ 'description' : 'Comedian and actor' ,
155
+ 'country' : 'United States'
156
+ },
157
+ {
158
+ 'name' : 'Ellen DeGeneres' ,
159
+ 'follower_count' : 87 ,
160
+ 'description' : 'Comedian' ,
161
+ 'country' : 'United States'
162
+ },
163
+ {
164
+ 'name' : 'Real Madrid CF' ,
165
+ 'follower_count' : 86 ,
166
+ 'description' : 'Football club' ,
167
+ 'country' : 'Spain'
168
+ },
169
+ {
170
+ 'name' : 'FC Barcelona' ,
171
+ 'follower_count' : 85 ,
172
+ 'description' : 'Football club' ,
173
+ 'country' : 'Spain'
174
+ },
175
+ {
176
+ 'name' : 'Rihanna' ,
177
+ 'follower_count' : 81 ,
178
+ 'description' : 'Musician and businesswoman' ,
179
+ 'country' : 'Barbados'
180
+ },
181
+ {
182
+ 'name' : 'Demi Lovato' ,
183
+ 'follower_count' : 80 ,
184
+ 'description' : 'Musician and actress' ,
185
+ 'country' : 'United States'
186
+ },
187
+ {
188
+ 'name' : "Victoria's Secret" ,
189
+ 'follower_count' : 69 ,
190
+ 'description' : 'Lingerie brand' ,
191
+ 'country' : 'United States'
192
+ },
193
+ {
194
+ 'name' : 'Zendaya' ,
195
+ 'follower_count' : 68 ,
196
+ 'description' : 'Actress and musician' ,
197
+ 'country' : 'United States'
198
+ },
199
+ {
200
+ 'name' : 'Shakira' ,
201
+ 'follower_count' : 66 ,
202
+ 'description' : 'Musician' ,
203
+ 'country' : 'Colombia'
204
+ },
205
+ {
206
+ 'name' : 'Drake' ,
207
+ 'follower_count' : 65 ,
208
+ 'description' : 'Musician' ,
209
+ 'country' : 'Canada'
210
+ },
211
+ {
212
+ 'name' : 'Chris Brown' ,
213
+ 'follower_count' : 64 ,
214
+ 'description' : 'Musician' ,
215
+ 'country' : 'United States'
216
+ },
217
+ {
218
+ 'name' : 'LeBron James' ,
219
+ 'follower_count' : 63 ,
220
+ 'description' : 'Basketball player' ,
221
+ 'country' : 'United States'
222
+ },
223
+ {
224
+ 'name' : 'Vin Diesel' ,
225
+ 'follower_count' : 62 ,
226
+ 'description' : 'Actor' ,
227
+ 'country' : 'United States'
228
+ },
229
+ {
230
+ 'name' : 'Cardi B' ,
231
+ 'follower_count' : 67 ,
232
+ 'description' : 'Musician' ,
233
+ 'country' : 'United States'
234
+ },
235
+ {
236
+ 'name' : 'David Beckham' ,
237
+ 'follower_count' : 82 ,
238
+ 'description' : 'Footballer' ,
239
+ 'country' : 'United Kingdom'
240
+ },
241
+ {
242
+ 'name' : 'Billie Eilish' ,
243
+ 'follower_count' : 61 ,
244
+ 'description' : 'Musician' ,
245
+ 'country' : 'United States'
246
+ },
247
+ {
248
+ 'name' : 'Justin Timberlake' ,
249
+ 'follower_count' : 59 ,
250
+ 'description' : 'Musician and actor' ,
251
+ 'country' : 'United States'
252
+ },
253
+ {
254
+ 'name' : 'UEFA Champions League' ,
255
+ 'follower_count' : 58 ,
256
+ 'description' : 'Club football competition' ,
257
+ 'country' : 'Europe'
258
+ },
259
+ {
260
+ 'name' : 'NASA' ,
261
+ 'follower_count' : 56 ,
262
+ 'description' : 'Space agency' ,
263
+ 'country' : 'United States'
264
+ },
265
+ {
266
+ 'name' : 'Emma Watson' ,
267
+ 'follower_count' : 56 ,
268
+ 'description' : 'Actress' ,
269
+ 'country' : 'United Kingdom'
270
+ },
271
+ {
272
+ 'name' : 'Shawn Mendes' ,
273
+ 'follower_count' : 57 ,
274
+ 'description' : 'Musician' ,
275
+ 'country' : 'Canada'
276
+ },
277
+ {
278
+ 'name' : 'Virat Kohli' ,
279
+ 'follower_count' : 55 ,
280
+ 'description' : 'Cricketer' ,
281
+ 'country' : 'India'
282
+ },
283
+ {
284
+ 'name' : 'Gigi Hadid' ,
285
+ 'follower_count' : 54 ,
286
+ 'description' : 'Model' ,
287
+ 'country' : 'United States'
288
+ },
289
+ {
290
+ 'name' : 'Priyanka Chopra Jonas' ,
291
+ 'follower_count' : 53 ,
292
+ 'description' : 'Actress and musician' ,
293
+ 'country' : 'India'
294
+ },
295
+ {
296
+ 'name' : '9GAG' ,
297
+ 'follower_count' : 52 ,
298
+ 'description' : 'Social media platform' ,
299
+ 'country' : 'China'
300
+ },
301
+ {
302
+ 'name' : 'Ronaldinho' ,
303
+ 'follower_count' : 51 ,
304
+ 'description' : 'Footballer' ,
305
+ 'country' : 'Brasil'
306
+ },
307
+ {
308
+ 'name' : 'Maluma' ,
309
+ 'follower_count' : 50 ,
310
+ 'description' : 'Musician' ,
311
+ 'country' : 'Colombia'
312
+ },
313
+ {
314
+ 'name' : 'Camila Cabello' ,
315
+ 'follower_count' : 49 ,
316
+ 'description' : 'Musician' ,
317
+ 'country' : 'Cuba'
318
+ },
319
+ {
320
+ 'name' : 'NBA' ,
321
+ 'follower_count' : 47 ,
322
+ 'description' : 'Club Basketball Competition' ,
323
+ 'country' : 'United States'
324
+ }
325
+ ]
326
+
327
+ def get_random_account ():
328
+ """Get data from random account"""
329
+ return random .choice (data )
330
+
331
+ def format_data (account ):
332
+ """Format account into printable format: name, description and country"""
333
+ name = account ["name" ]
334
+ description = account ["description" ]
335
+ country = account ["country" ]
336
+ print (f'{ name } : { account ["follower_count" ]} ' )
337
+ return f"{ name } , a { description } , from { country } "
338
+
339
+ def check_answer (guess , a_followers , b_followers ):
340
+ """Checks followers against user's guess
341
+ and returns True if they got it right.
342
+ Or False if they got it wrong."""
343
+ if a_followers > b_followers :
344
+ return guess == "a"
345
+ else :
346
+ return guess == "b"
347
+
348
+
349
+ def game ():
350
+ print (logo )
351
+ score = 0
352
+ game_should_continue = True
353
+ account_a = get_random_account ()
354
+ account_b = get_random_account ()
355
+
356
+ while game_should_continue :
357
+ account_a = account_b
358
+ account_b = get_random_account ()
359
+
360
+ while account_a == account_b :
361
+ account_b = get_random_account ()
362
+
363
+ print (f"Compare A: { format_data (account_a )} ." )
364
+ print (vs )
365
+ print (f"Against B: { format_data (account_b )} ." )
366
+
367
+ guess = input ("Who has more followers? Type 'A' or 'B': " ).lower ()
368
+ a_follower_count = account_a ["follower_count" ]
369
+ b_follower_count = account_b ["follower_count" ]
370
+ is_correct = check_answer (guess , a_follower_count , b_follower_count )
371
+
372
+ print (logo )
373
+ if is_correct :
374
+ score += 1
375
+ print (f"You're right! Current score: { score } ." )
376
+ else :
377
+ game_should_continue = False
378
+ print (f"Sorry, that's wrong. Final score: { score } " )
379
+ play = input ("Dow want to restart? y/n: " )
380
+
381
+ play = input ("Do you want to start? y/n: " )
382
+ while play == 'y' :
383
+ game ()
0 commit comments