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
I'm making a game. I'm trying to make it so that instead of how I currently have it, starting whenever I click the screen, it st
Lera25 [3.4K]
That’s cool I’ll play the game tonight if I can
6 0
3 years ago
Francis has applied for admission to a computer science program, and one of the requirements for admission is the completion of
Nataly_w [17]

Answer:

an aptitude test.

Explanation:

Based on the scenario being described it can be said that the test that Francis is scheduled to take would be classified as an aptitude test. This is a test that tries to determine an individual's innate ability at a particular competency. These are abilities such as sequencing skills and abstract reasoning skills, and are the results of these tests are used in order to see where a candidate can best be placed within a program/company to best perform.

8 0
3 years ago
Read 2 more answers
The last time period the federal government of these United States ran a budget surplus was ________.
lina2011 [118]
Your answer is a 1998-2001
3 0
3 years ago
Least common multiple of 78,90, and 140
Daniel [21]
The least common multiple (LCM) of 78, 90, and 140 is: 16,380

78 × 210 = 16,380
90 × 182 = 16,380
140 × 117 = 16,380
5 0
4 years ago
Read 2 more answers
Which type of software is created on user dimension​
Ratling [72]

Answer:

Application and system software is created on user dimension.

6 0
3 years ago
Other questions:
  • When are numbered lists generally used?
    14·2 answers
  • ​What file system below does not support encryption, file based compression, and disk quotas, but does support extremely large v
    10·1 answer
  • Hydropower uses moving water to do work, such as grinding grains in a mill. True False
    7·1 answer
  • This common technique, employed at the edge of a network, eliminates the need for public IP addresses on a private network while
    8·1 answer
  • ____ is the code of acceptable behaviors users should follow while on the internet; that is, it is the conduct expected of indiv
    10·1 answer
  • Which of these is a method of selecting multiple items in Impress or PowerPoint? A. holding down the Ctrl key while clicking ite
    9·2 answers
  • Paul is playing a game when his computer shuts down unexpectedly. Paul has noticed recently that his fans are running very loud.
    13·1 answer
  • If you need seamless access to the OS, ________ is better.
    8·1 answer
  • What is the lowest layer of the OSI model at which LANs and WANs support the same protocols?
    5·1 answer
  • What happens if none of the selector values match selector in a simple case expression in pl/sql
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!