Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that plays number-guessing game from 1-10. The user can guess until they get it right AND count the number of tries it

Write a program that plays number-guessing game from 1-10. The user can guess until they get it right AND count the number of tries it takes them to guess it. That means it will keep looping as long as the guess is different from the secret number.

image text in transcribed

Task 1: 1. Write a program that plays number-guessing game from 1-10. The user can guess until they get it right AND count the number of tries it takes them to guess it. That means it will keep looping as long as the guess is different from the secret number. I have chosen a number between 1 and 10. Try to guess it. Your guess: 5 That is incorrect. Guess again. Your guess: 4 That is incorrect. Guess again. Your guess: 8 That is incorrect. Guess again. Your guess: 6 That's right! You're a good guesser. It only took you 4 tries

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions