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
Select the correct answer
VMariaS [17]

Answer:

Digital pen

Explanation:

It is digital pen because it is basically a pen for electronics which you can write your signature with it.

5 0
3 years ago
Read 2 more answers
Jason works for a restaurant that serves only organic, local produce. What
sergeinik [125]

Answer:

green buisness

Explanation:

8 0
3 years ago
Read 2 more answers
Can you guys give some samples of STEM-related studies?​
anygoal [31]

Answer:

D :)))))

Explanation:

hope this helps

5 0
3 years ago
Read 2 more answers
Which method can be used to write data to a text file opened with the BufferedWriter object outfile?
maksim [4K]

Answer:

Option (d) outfile.write();

Explanation:

As the object created for the class BufferedWriter is outfile, outfile.write is the correct syntax for writing in a text file. Here, write is the method used for writing into a text file. The data present is written in the textfile. Here, the text file is opened before writing the text into the file. Option (d) is correct.

Option (a) outfile.newLine(); is used to separate the lines. This is used to break the existing lines into smaller lines. This can also be used to start a new line. Here, newLine() is the method.So, option (a) is not suitable.

Option (b) outfile.existLine(); This is not a valid syntax as there is no method called existLine() in the class BufferedWriter. So, this is a wrong option.

Option (c) Write(outfile); This is not a valid syntax for writing in a text file. This is a wrong option.

7 0
3 years ago
How has information technology made piracy possible
ololo11 [35]
Well, more and more people are buying products and then uploading them online so that other people, who may not have the money or just don't want to buy them can download them for free. Of course, this is illegal, however it is a common practice all over the globe. Even if you are not downloading, but rather just watching a show on a website where you don't have to pay for it - it is still piracy.
3 0
3 years ago
Other questions:
  • Drag the correct type of update to its definition.
    5·1 answer
  • If you press the tab key when you're in in the last cell of a table,
    10·1 answer
  • When you tell a computer what to do, you are providing input?
    11·1 answer
  • Can somebody explain me what this code does in a few or one sentence?#include #include using namespace std;int main () { const i
    12·1 answer
  • A small company has hired you to take over its IT needs. The company currently has seven on-site employees and 12 remote employe
    12·1 answer
  • Files with what two file extensions are commonly known as tarballs??
    8·1 answer
  • Blood Alcohol Level (BAL) is the ratio between the alcohol consumed and the blood in the body. A. True B. False
    12·2 answers
  • Help me please. I'LL MARK BRAINIEST
    15·1 answer
  • What is the answer ????​
    13·2 answers
  • What is a phone made out of dna
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!