menu
QAmmunity.org
Login
Register
My account
Edit my Profile
Private messages
My favorites
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.4k
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.
← Prev Question
Next Question →
Related questions
asked
Nov 19, 2023
23.7k
views
Fill in the Blank Complete the code. from random import randint # Generate and save a random number. correct = randint(1,10) # Initialize the variable to count the number of guesses. attempts = 0 # Create
Hai Hw
asked
Nov 19, 2023
by
Hai Hw
8.5k
points
Computers and Technology
high-school
2
answers
6
votes
23.7k
views
asked
Sep 3, 2024
39.3k
views
Which line of code needs to be included before you can execute num = random.randint(1,10)? Group of answer choices create random import random import randint randint = random
Bguiz
asked
Sep 3, 2024
by
Bguiz
8.4k
points
Computers and Technology
high-school
1
answer
0
votes
39.3k
views
asked
Jul 18, 2024
126k
views
Import random as r val = 35 P=7 Num=0 for i in range(1,5): Num=val+r.randint(0,p-1) print(Num,"$",end="") p=p-1
Oryol
asked
Jul 18, 2024
by
Oryol
7.3k
points
Computers and Technology
college
1
answer
0
votes
126k
views
Ask a Question
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.
9.5m
questions
12.2m
answers
Other Questions
“What does it mean when we “rework” copyrighted material?”
Seven basic internal components found in a computer tower
Please help me ! All you do is just put it it all in your own words ! Please this is for my reported card!i don't know how to put it in my own words because my English is not that good!
describe an advance in technology that makes life more enjoyable. what discoveries contribute to this technology?
Disadvantages of using animation in advertising? advantages and disadvantages of using animation for education? advantages and disadvantages of using animation in entertainment?
Twitter
WhatsApp
Facebook
Reddit
LinkedIn
Email
Link Copied!
Copy
Search QAmmunity.org