Oct-07-2021, 11:13 AM
(This post was last modified: Oct-07-2021, 11:13 AM by Dunxx.
Edit Reason: Added code tags
)
My computer science teacher doesn't know python, ive spent 20 minutes trying to figure this out but cannot.
This is my task
You are required to produce a simple guess the Number Game
Program should generate an integer within the range of 1 to 10
Player should guess the number
If the guess is wrong, your program should tell the player if the number guessed is smaller or greater than the number.
This should continue until the player makes a correct guess.
Finally, it awards the player with five stars if he/she gets it right the time, four stars if he/she gets it right the second time and three stars if he/she gets it right the third time.
Make it into Python code.
What I've done.
This is my task
You are required to produce a simple guess the Number Game
Program should generate an integer within the range of 1 to 10
Player should guess the number
If the guess is wrong, your program should tell the player if the number guessed is smaller or greater than the number.
This should continue until the player makes a correct guess.
Finally, it awards the player with five stars if he/she gets it right the time, four stars if he/she gets it right the second time and three stars if he/she gets it right the third time.
Make it into Python code.
What I've done.
count=0 import random i=random.randint(1,11) while True: guess=input(int("Guess the number that was generated from 1-10")) if guess==i: while False: elif i<guess: print("The number is smaller") count=count+1 elif: print("The number is greater") count=count+1 if count==1: print("You got 4 stars") elif count>=2: print("You got 3 stars") else count==0: print("you got 5 stars")