menu
QAmmunity.org
Login
Register
My account
Edit my Profile
Private messages
My favorites
Register
Ask a Question
Questions
Unanswered
Tags
Categories
Ask a Question
You wrote a program to allow the user to guess a number. Complete the code to generate a random integer between one and 10. from random import randint # Generate and save a random number correct
asked
Sep 16, 2022
112k
views
4
votes
You wrote a program to allow the user to guess a number. Complete the code to generate a random integer between one and 10.
from random import randint
# Generate and save a random number
correct
Computers and Technology
high-school
Ryan Carter
asked
by
Ryan Carter
8.2k
points
answer
comment
share this
share
0 Comments
Please
log in
or
register
to add a comment.
Please
log in
or
register
to answer this question.
1
Answer
4
votes
if we are talking about python
from random import randint
x = random.randint(1,10)
y = input(“enter a guess”)
if x == y:
print(“correct”)
else:
print(“incorrect, the answer was “, x)
Luntegg
answered
Sep 21, 2022
by
Luntegg
7.7k
points
ask related question
comment
share this
0 Comments
Please
log in
or
register
to add a comment.
Ask a Question
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.
9.4m
questions
12.1m
answers
Other Questions
“What does it mean when we “rework” copyrighted material?”
The book shows how to add and subtract binary and decimal numbers. However, other numbering systems are also very popular when dealing with computers. The octal (base 8) numbering system is one of these.
Seven basic internal components found in a computer tower
Disadvantages of using animation in advertising? advantages and disadvantages of using animation for education? advantages and disadvantages of using animation in entertainment?
Explain why binary codes are used to represent characters, numbers and symbols :)
Twitter
WhatsApp
Facebook
Reddit
LinkedIn
Email
Link Copied!
Copy
Search QAmmunity.org