So I created this project that records football (soccer) stats. Up to now it records only corner and free kicks but I want to record the possession time between the 2 teams. My main problem is that when I try to keep possession time, the other functions won't work. Here's what I've tried:
import time
fk_range = range(0, 1000)
fk_list = list(fk_range)
ck_range = range(0, 1000)
ck_list = list(ck_range)
def body():
while True:
choice = input("")
if choice == "fk":
first_number_fk = fk_list[0]
fk_list.remove(first_number_fk)
number_fk = fk_list[0]
string_number_fk = str(number_fk)
print("Free Kick(s)", string_number_fk)
elif choice == "ck":
first_number_ck = ck_list[0]
ck_list.remove(first_number_ck)
number_ck = ck_list[0]
string_number_ck = str(number_ck)
print("Corner Kick(s): ", string_number_ck)
if choice == "home team":
start_home = time.time()
input()
end_home = time.time()
if choice == "away_team":
start_away = time.time()
input()
end_away = time.time()
elapsed_home = end_home - start_home
elapsed_away = end_away - start_away
elif choice == "q":
print(elapsed_away)
print(elapsed_home)
body()
This doesn't work, but this is an idea of what I've got. If you didn't understand what I mean, please comment below so I can explain in more detail.