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
Get step-by-step solutions from verified subject matter experts
