from art import logo, vs
from game_data import data
import random
from replit import clear
list_B = (random.choice(data))
def compare(list_A_follower, list_B_follower, guess):
if list_A['follower_count'] > list_B['follower_count']:
return guess == "a"
else:
return guess == "b"
score = 0
result = True
while result:
clear()
print(logo)
if score != 0:
print(f"You are right. Current score: {score}.")
list_A = list_B
list_B = (random.choice(data))
if list_A == list_B:
list_B = (random.choice(data))
print(
f"Compare A: {list_A['name']}, {list_A['description']}, from {list_A['country']}"
)
print(vs)
print(
f"Against B: {list_B['name']}, {list_B['description']}, from {list_B['country']}"
)
print(
"--------------------------------------------------------------------------------"
)
guess = input("Who has more followers? Type 'A' or 'B'.\n").lower()
result = compare(list_A['follower_count'], list_B['follower_count'], guess)
if result:
score += 1
clear()
print(logo)
print(f"Sorry, that's wrong. Final score: {score}")