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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 23:00, sarahnd6907
Explain briefly why you cannot expect to find a previous version of every file with which you work.
Answers: 1
image
Computers and Technology, 23.06.2019 03:00, jarteria0
State 7 common key's for every keyboard
Answers: 1
image
Computers and Technology, 24.06.2019 13:00, pineapplepizaaaaa
If you add the following to the query grid in an access query, what is it called? salestaxamt: [salestaxrate]*[totalsale] formula calculated field total calculation
Answers: 2
image
Computers and Technology, 24.06.2019 16:50, Ameilasmickle15
How many types of string types does python support?
Answers: 1
You know the right answer?
Guessing game project

you will create a python program in sandbox named guessing game. <...

Questions in other subjects:

Konu
Computers and Technology, 14.12.2021 05:20