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
Paladinen [302]
3 years ago
14

Need 2.5 Code Practice Answers

Computers and Technology
2 answers:
konstantin123 [22]3 years ago
4 1

Answer:

import random

random.seed(1,10)

a = random.randint (1,10)

b = random.randint (1,10)

print ("What is: " + str(a) + " X " + str(b) + "?")  

ans = int(input("Your answer: "))  

if (a * b == ans):  

   print ("Correct!")  

else:  

   print ("Incorrect!")

Explanation:

iragen [17]3 years ago
3 1

Answer:

import random

#random.seed() should not be used here as this method will produce same number again and again

a = random.randint(1,11) #this method will generate random number between 1 and 10  

b = random.randint(1,11)

print ("What is: " + str(a) + " X " + str(b) + "?")  

ans = int(input("Your answer: "))

if (a * b == ans):

   print ("Correct!")

else:

   print ("Incorrect!")

Output :

What is: 8 X 5?

Your answer: 40

Correct!

Explanation:

  • First for producing random numbers,random module has to be imported.
  • As mentioned in answer, random.seed() method is used to generate same random number again and again. Here we need to generate 2 different random numbers that is why we won't use this method.
  • To produce a random number, randint() method from random module is used. This method takes 2 parameters i.e. a low and high value. The low value is inclusive and the high value is exclusive. That is why , to get a number between [1,10], randint() takes 1 as low value(inclusive) and 11 as high value(exclusive).

Elo Lemon
2 years ago
This literally doesn’t work, I copy and pasted it into python and I get an EOD error when reading a line, help?!
You might be interested in
Edhesive silly questionsj
Alex17521 [72]
Mnhhbjhhhhdndkdjdjddnnxnx
4 0
4 years ago
An authenticated user can add up to how many computer accounts to the domain, by default
Brums [2.3K]
By default, 10 computers can be joined to the domain by both users and administrators. As long as a user is authenticated against the Active Directory, he or she can add up to 10 computers to the domain.
While this one posses as an advantage for smaller companies, it is not a desirable feature for bigger companies since they have to control more tightly who can add machines to their domain.
7 0
3 years ago
Jason works as an accountant in a department store. He needs to keep a daily record of all the invoices issued by the store. Whi
kotykmax [81]

Are there any options

3 0
3 years ago
Read 2 more answers
Ned and Mary Ann are saving their files to a CD. When prompted, Ned will click on Burn file to disk, indicate the recording spee
r-ruslan [8.4K]

Answer:

Should be Ned.

5 0
3 years ago
Read the following characteristic:
Ivanshal [37]

Answer:

A goal of procedural programming

An advantage of object oriented programming

A disadvantage of object oriented programming

A drawback of procedural programming

3 0
2 years ago
Other questions:
  • When employees are hired, they agree to only use cell phones during breaks. How would you classify this?
    13·2 answers
  • Olivia creates a personal budget. She enters her current savings account balance in cell D3. In cell A3, she calculates her inco
    8·1 answer
  • You can avoid culture shock by ____________.
    10·2 answers
  • Which of the following is NOT a fixed expense?
    6·1 answer
  • Which one of the following will not be considered as a microcomputer?
    12·2 answers
  • To share a document in my online electronic journal, I should select the option to _____.
    14·1 answer
  • Write a program whose input is a character and a string, and whose output indicates the number of times the character appears in
    11·1 answer
  • 2. You have noticed over the past several days that your computer is running more slowly
    6·2 answers
  • Kai notices his laptop is running sluggishly, so he wants to check his system resources for any issues. Which utility can he use
    11·2 answers
  • It would be at least two decades before some of
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!