Bin neu
PS : Programm ist neu und nicht fertig
Gruß Elias
Code: Alles auswählen
def EnterGamerTag():
print("===================================")
print("Please enter your gamer tag here : ")
print("===================================")
GamerTag = input("")
print("Your registered gamer tag is", GamerTag, "Is that right")
answer1 = input("")
if "Yes" in answer1:
EnterResults()
elif "No" in answer1:
print ("LOLO")
elif answer1 != "Yes" and answer1 !="No":
g = input("Press any key to retry")
EnterGamerTag()
#def AccessResults():
def EnterResults():
print("===================================")
print("Hey, to make a statistic, we need")
print("you to enter your game results")
print("===================================")
hits = input("Please enter your hits")
misses = input("Please enter your misses")
Qoute = (int(hits) / int(misses));
Points = (int(hits) * 10)
if (int(hits) > 25):
Points = (int(Points) + 75)
print("Calculating...")
print("Your hits and misses are", hits, "/", misses)
print("So your hits and misses quote is", Qoute)
print ("You earned", Points, "experience points in this game")
SaveResults()
def SaveResults():
print("Do you want to save your stats for ", GamerTag, "?" )
answer2 = input("")
if "Yes" in answer2:
print("Ok, we will safe your stats for", GamerTag)
file = open("{}.txt".format(GamerTag), "w+")
file.write("{}".format(GamerTag))
file.write("{}".format(hits))
file.write("{}".format(misses))
elif "No" in answer2:
print ("LOLO")
elif answer2 != "Yes" and answer2 !="No":
g = input("Invalid answer, press any key to retry")
SaveResults(GamerTag, hits, misses)
def menu():
print("PRESS ONE")
choice = input()
if choice == "1":
EnterGamerTag()
if choice =="2":
EnterResults()
menu()