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, 21.06.2019 18:30
Ayear in the modern gregorian calendar consists of 365 days. in reality, the earth takes longer to rotate around the sun. to account for the difference in time, every 4 years, a leap year takes place. a leap year is when a year has 366 days: an extra day, february 29th. the requirements for a given year to be a leap year are: the year must be divisible by 4if the year is a century year (1700, 1800, the year must be evenly divisible by 400some example leap years are 1600, 1712, and 2016.write a program that takes in a year and determines whether that year is a leap year.ex: if the input is 1712, the output is: 1712 is a leap year.ex: if the input is 1913, the output is: 1913 is not a leap year.
Answers: 2
question
Computers and Technology, 22.06.2019 01:00
Search the web for two examples of digital art that you like. the examples must be from different mediums (example: one digital photo and one computer animation not two computer animations). compose an essay for each example you choose about why the piece appeals to you, and identify the medium used.
Answers: 1
question
Computers and Technology, 22.06.2019 07:30
An endless cycle of creation and response on the internet is called
Answers: 1
question
Computers and Technology, 22.06.2019 20:00
The blank button automatically displays next to the data when you select a range of numeric data which is an available option for creating a chart
Answers: 3
You know the right answer?
Guessing game project

you will create a python program in sandbox named guessing game. <...
Questions
question
Mathematics, 07.12.2020 21:50
question
Social Studies, 07.12.2020 21:50
Questions on the website: 13722359