subject

Guessing game project

you will create a python program in sandbox named guessing game.
start by putting the random function in your code line 1.
import random

with a print statement saying welcome to the guessing game.
next we will get python to create a random number between 1-10. this is how we do it.
number = random. randint(1, 10)

next we will create a variable called player_name and variable called number of guesses
player_name = input("hello, what's your name? ")
number_of_guesses = 0

now write a print statement that says welcome player_name to the guessing game!

write a print statement that says “you have up to 5 guesses to get the correct number!

using a while loop you will have the user get up to 5 guesses

while number_of_guesses < 5:
guess = int(input("enter your guess! "))
number_of_guesses += 1

***finish the rest on your own.
**hint you will use if statements to let the user know if they guessed too high or too low.
if guess == number you will put break in the code to end the loop.
then using print statement you will let the user know how many guesses it took them to get the correct number or you will tell them they lost.

good luck

this is for codehs i need the code

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 09:00
Which best describes the condition under which the unicode output is the same as plain text?
Answers: 3
question
Computers and Technology, 22.06.2019 09:30
Is a string of code written to hurt others by damaging or destroying
Answers: 1
question
Computers and Technology, 22.06.2019 16:30
Technician a says that a dry sump system uses no oil storage sump under the engine. technician b says that a wet sump system uses no oil storage sump under the engine. who is correct?
Answers: 3
question
Computers and Technology, 22.06.2019 20:10
Assume that minutes is an int variable whose value is 0 or positive. write an expression whose value is "undercooked" or "soft-boiled" or "medium-boiled" or "hard-boiled" or "overcooked" based on the value of minutes. in particular: if the value of minutes is less than 2 the expression's value is "undercooked"; 2-4 would be a "soft-boiled", 5-7 would be "medium-boiled", 8-11 would be "hard-boiled" and 12 or more would be a "overcooked".
Answers: 1
You know the right answer?
Guessing game project

you will create a python program in sandbox named guessing game. <...
Questions
question
Mathematics, 02.09.2019 17:30
Questions on the website: 13722362