Question
i need a code for this in PYTHON please! Task: Create a simple Guessing Game using Nested If else statements file Name: yourlastname3_4.py Rules: The
i need a code for this in PYTHON please!
Task: Create a simple Guessing Game using Nested If else statements
file Name: yourlastname3_4.py
Rules: The computer generates a random number between 1 and 10 The player gets 2 chances to guess the number If the numbers are equal, the player wins. If the player's number is higher than the winning number tell the player to guess lower If the player's number is lower than the winning number tell the player to guess higher Otherwise, the computer wins
Output Examples:
Guess on 1st try
Welcome to Guess a Number Game You will be granted 2 chances Guess a number between 1 and 10 5 Wow, you won! Congratulations! Game over. goodbye
Guess on 2nd Try
Welcome to Guess a Number Game You will be granted 2 chances Guess a number between 1 and 10 9 Too high, Try again 6 Wow, you won! Game over. goodbye
Loses Game
Welcome to Guess a Number Game You will be granted 2 tries Guess a number between 1 and 10 9 Too high, Try again 1 Your Guess is too low Computer Wins The winning number was 8 Game over. goodbye
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started