 # Day 14 - Whos Higher

Nov 22nd, 2021
611
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. from logo import logo
2. from logo import vs
3. from data import data
4. import random
5.
6. print(logo)
7. game = True
8. score = 0
9. while game == True:
10.     a = random.choice(data)
11.     b = random.choice(data)
12.     a_name = a["name"]
13.     a_descr = a["description"]
14.     a_country = a["country"]
15.     a_follows = a["follower_count"]
16.     a_grp = f"Compare a: {a_name}, {a_descr}, from {a_country}"
17.     b_name = b["name"]
18.     b_descr = b["description"]
19.     b_country = b["country"]
20.     b_follows = b["follower_count"]
21.     b_grp = f"Against b: {b_name}, {b_descr}, from {b_country}"
22.     if a == b:
23.         b = random.choice(data)
24.         a = random.choice(data)
25.     print(a_grp)
26.     print(vs)
27.     print(b_grp)
28.     print(f"Your current score is: {score}")
29.     usrguess = input("Who has more followers? type 'A' or 'B'").lower()
30.     if a_follows > b_follows and usrguess == "a":
32.         score += 1
33.     elif b_follows > a_follows and usrguess == "b":
35.         score += 1
36.     else:
37.         print(f'WRONG! Nice Try! Better Luck Next Time! \n your score was: {score}')
38.         game = False
39.
40.
41.
42.
43.