ScratchData LogoScratchData
Back to funstuff83's profile

python coding using pycharm

FUfunstuff83•Created October 10, 2024
python coding using pycharm
0
0
4 views
View on Scratch

Instructions

im working on a math game 2.0

Description

from time import sleep score = 0 number_one = 1 number_two = number_one correct = number_one + number_two def main_code(): global score, number_one, number_two, correct while True: question = int(input(f"What is {number_one} + {number_two} ? ")) if question == correct: print("Correct!") score += 1 number_one += number_two number_two = number_one correct = number_one + number_two sleep(1) else: retry = input("Sorry, that's wrong. Do you want to try again? ").lower() if retry == "yes": print("Ok, restarting...") score = 1 number_one = 1 number_two = number_one correct = number_one + number_two sleep(1) print(f"your score is...{score}") sleep(1) main_code() elif retry == "no": print("ok") sleep(1) print(f"your score is...{score}") sleep(1) break main_code()

Project Details

Project ID1079781113
CreatedOctober 10, 2024
Last ModifiedOctober 10, 2024
SharedOctober 10, 2024
Visibilityvisible
CommentsAllowed