hey guys i got this python code that i dont know how to do a function. it has 2 attempt to answer a question before it moves onto the next. so i want it on the first attempt to earn 10 points but if on the second attempt 5 point but if they get it wrong its 0 points. at the end it prints out their score.
Score = 0
i = 0
while i < 3:
song = input("Guess the song title S... R.....'s' Theme Song?:")
if song == "Seth Rollins Theme Song":
print("That's the correct song")
break
else:
i += 1
if i == 3:
print("Too many attempts")
break
else:
print(f"That's the wrong song, you have {3-i} attempts left")
i = 0
while i < 3:
answer1 = input("Who made Seth Rollins Theme Song ? \n A. The Miz \n B. Mickie James \n C. Brock Lesnar \n Answer: ")
if answer1 == "A" or answer1 == "The Miz":
print("That's the correct song")
break
else:
i += 1
if i == 3:
print("Too many attempts")
break
else:
print(f"That's the wrong song, you have {3-i} attempts left")
i = 0
while i < 3:
song = input("Guess the song title The U......... Theme Song?:")
if song == "The Undertaker's Theme Song":
print("That's the correct song")
break
else:
i += 1
if i == 3:
print("Too many attempts")
break
else:
print(f"That's the wrong song, you have {3-i} attempts left")
i = 0
while i < 3:
answer1 = input("Who made The Undertaker Theme Song ? \n A. Ultimate Warrior \n B. Shawn Michaels \n C. Kane \n Answer: ")
if answer1 == "B" or answer1 == "Shawn Michaels":
print("That's the correct song")
break
else:
i += 1
if i == 3:
print("Too many attempts")
break
else:
print(f"That's the wrong song, you have {3-i} attempts left")
i = 0
while i < 3:
song = input("Guess the song title S.... C... S.... A..... Song?:")
if song == "Stone Cold Steve Austin Theme Song":
print("That's the correct song")
break
else:
i += 1
if i == 3:
print("Too many attempts")
break
else:
print(f"That's the wrong song, you have {3-i} attempts left")
i = 0
while i < 3:
answer1 = input("Who made Stone Cold Steve Austin Theme Song ? \n A. Sycho Sid \n B. Bret Hart \n C. The Brothers of Destruction \n Answer: ")
if answer1 == "C" or answer1 == "The Brothers of Destruction":
print("That's the correct song")
break
else:
i += 1
if i == 3:
print("Too many attempts")
break
else:
print(f"That's the wrong song, you have {3-i} attempts left")
i = 0
while i < 3:
song = input("Guess the song title C. P... Theme Song?:")
if song == "CM Punk Theme Song":
print("That's the correct song")
break
else:
i += 1
if i == 3:
print("Too many attempts")
break
else:
print(f"That's the wrong song, you have {3-i} attempts left")
i = 0
while i < 3:
answer1 = input("Who made CM Punk Theme Song ? \n A. D - Generation X \n B. Chris Benoit \n C. The NWO \n Answer: ")
if answer1 == "B" or answer1 == "The NWO":
print("That's the correct song")
break
else:
i += 1
if i == 3:
print("Too many attempts")
break
else:
print(f"That's the wrong song, you have {3-i} attempts left")
i = 0
while i < 3:
song = input("Guess the song title T..... H Theme Song?:")
if song == "Triple H Theme Song":
print("That's the correct song")
break
else:
i += 1
if i == 3:
print("Too many attempts")
break
else:
print(f"That's the wrong song, you have {3-i} attempts left")
i = 0
while i < 3:
answer1 = input("Who made Triple H Theme Song ? \n A. Trish Stratus \n B. Johncena \n C. AJ Style \n Answer: ")
if answer1 == "A" or answer1 == "Trish Stratus":
print("That's the correct song")
break
else:
i += 1
if i == 3:
print("Too many attempts")
break
else:
print(f"That's the wrong song, you have {3-i} attempts left")
print("Your Score out of 10 is",Score )