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]
2 years ago
14

Need 2.5 Code Practice Answers

Computers and Technology
2 answers:
konstantin123 [22]2 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]2 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
How can the use of new technology in industry benefit the us government
Karo-lina-s [1.5K]
It Can Benefit Them Because This Generation Uses Technology And Such We Don't Live In A Primary Source World Where We Write Letters And Send Them Away To Where Ever Country , We A Secondary Country Because Now We Use Technology And We Are More Advance With Things Which Benefits Us Even More In Bigger And Better Ways
5 0
3 years ago
Read 2 more answers
What are 3 software programs for mobile computing?
Dimas [21]

Answer:

1.Communication Devices

2.Mobile hardware

3.Mobile software and apps

(smartphones, laptop, etc)

3 0
2 years ago
How many ways do advertisers determine target audiences ??????
guapka [62]
Your most logical answer is B 3. :)
7 0
2 years ago
Enna always says thank you when people give her gifts. She even writes thank-you cards. On holidays, Enna remembers
Mashcka [7]

Answer:

trait

Explanation:

7 0
2 years ago
What is wrong with my code...
stiv31 [10]
I'm not sure of the problem that you had in the first place, but I can point out that in your "bigger" method, if a number is greater than one then it is bigger, however the else statement says that the number *can* also be equal[==] to the second argument, so for example bigger(1,1) it would check if 1 > 1 and return false, so it will return that b[the second 1] is bigger! Hope this helps :D
3 0
3 years ago
Other questions:
  • 11. You should type _
    6·2 answers
  • The four functions of a computer are
    5·1 answer
  • What is the role of the constructor for an object?
    5·1 answer
  • Consider the following program segment: //include statement(s) //using namespace statement int main() { //variable declaration /
    9·1 answer
  • __________ is the order of arrangement of files and folders.
    6·1 answer
  • Whats wrong with my code for .addEventListener
    11·1 answer
  • Does analogue conversation take place in source as transmitter?
    5·2 answers
  • How do you get The gold chip on Megaman x3 snes I want To know
    11·1 answer
  • 7 TH GRADE QUESTION...PLS HELP
    12·2 answers
  • what is a program or collection of programs that enable a person to manipulate a visual images on a computer​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!