1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
notsponge [240]
3 years ago
13

Write a simple number guessing game Python program. In this code, generate a random integer between 1-10 (both included) and ask

the user to guess the number in three attempts. Print appropriate responses to the user such as "You won!" or "You failed"
Computers and Technology
1 answer:
seraphim [82]3 years ago
6 0

Answer:

from random import randint

num = randint(1,10)

count =0

while count<3:

 userNum = int(input("Guess a Number "))

 if num ==userNum:

   print("You won")

   break

 else:

   print("Wrong try again")

 count = count+1

Explanation:

Import randint from random

generate a random number between (1,10) and assign to num

create a loop control variable count set to 0

In a While statement with the condition count<3 prompt user to make a guess

if guess is correct print you won and break

else print wrong try again and increase count by 1

You might be interested in
Which best describes inserting a table using the Table Gallery
balandron [24]
The table gallery is to help you create the table.
4 0
3 years ago
Read 2 more answers
______ is using material created by others without obtaining permission from the original authors.
Leto [7]
Plagiarism is the answer to the blank
6 0
3 years ago
Read 2 more answers
Electrical data suitable for transmission is called a(n)
Deffense [45]

Answer:

Signal

Explanation:

4 0
3 years ago
Does a soda vending machine Give reciepts?<br><br>need for computer science hw
kupik [55]
No, they do not give receipts.<span />
6 0
3 years ago
Read 2 more answers
In a paragraph discuss 5 steps of saving a document in a storage device.<br>​
zubka84 [21]
<h2>The five steps of saving a document in a storage device are firstly, click File. Secondly, click Save As.</h2><h2> In addition, click Computer. Moreover, double click the storage device and type file name. Lastly, click Save or Enter.</h2>
6 0
2 years ago
Other questions:
  • Which of the following is an occupation management group? Select the choice that best answers the question.
    15·1 answer
  • Your organization wants to implement a 5-year rotation plan for all of its computing devices. What percentage of the computer fl
    10·2 answers
  • Wide area networks are defined by their ability to
    14·2 answers
  • A chef writing up her famed recipe for beef stew realizes she has switched parsley and oregano everywhere in the recipe. The che
    13·1 answer
  • The part of the computer that contains the brain, or central processing unit, is also known as the
    15·1 answer
  • How can the function anotherFunc2 change the contents of the second element of t?
    5·1 answer
  • What steps might a company or organization need take in order to keep its digital data secure online?
    8·1 answer
  • What is a credit card balance? A...The amount of interest you must pay the credit card company B...The required minimum payment
    15·1 answer
  • You’re configuring a Web-based intranet application on the WebApp server, which is a domain member. Users authenticate to the We
    13·1 answer
  • Hi who plays among us
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!