-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhigher_lower.py
More file actions
57 lines (48 loc) · 1.71 KB
/
higher_lower.py
File metadata and controls
57 lines (48 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import random
from game_data import data
from higher_lower_art import logo
from higher_lower_art import vs
print(logo)
start = True
def game():
points = 0
playing = True
while playing:
data_length = len(data)
person1 = random.choice(range(data_length))
person2 = random.choice(range(data_length))
person_data1 = data[person1]
print_data1 = person_data1["name"],\
person_data1["description"],\
person_data1["country"]
person_data2 = data[person2]
print_data2 = person_data2["name"],\
person_data2["description"],\
person_data2["country"]
print (print_data1)
print(vs)
print (print_data2)
choice = input("WHat is Your choice: ")
if choice == "t" and person_data1["follower_count"] > person_data2["follower_count"]:
print("yes")
points += 1
print("")
elif choice == "t" and person_data1["follower_count"] < person_data2["follower_count"]:
print("no")
print(f"these are your points: {points}")
playing = False
elif choice == "b" and person_data1["follower_count"] > person_data2["follower_count"]:
print("yes")
points += 1
print("")
elif choice == "b" and person_data1["follower_count"] < person_data2["follower_count"]:
print("no")
print(f"these are your points{points}")
playing = False
game()
while start:
start_again = input("Would yo like to start again? ")
if start_again == "yes":
game()
else:
start = False