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
A word or line of a paragraph at the top of a page hanging indent is called ______
Iteru [2.4K]

Answer:

The answer is: second line indent

Explanation:

Also known as a second line indent, sets off the first line of a paragraph by positioning it at the margin, and then indenting each subsequent line of the paragraph.

8 0
3 years ago
Write a chemical reaction to show that nitric acid contains nitrogen​
sleet_krkn [62]

Answer:

HNO3 &NO2

Explanation:

7 0
3 years ago
Design a GUI program to find the weighted average of four test scores. The four test scores and their respective weights are giv
Alexus [3.1K]

<u>Answer:</u>

I am writing <em>partial code in</em> <em>c++ to calculate weighted average</em>. The weighted average should be calculated based on multiplying the test score and its <em>respective weight and finally add all the test score.</em>

<u>Explanation:</u>

<em>int arrtestscore[100];</em>

<em>int arrweight[100];</em>

<em>int n;</em>

<em>double weightedavg;</em>

<em>cout<<”Enter the number of test score for which weighted average needs to be calculated”;</em>

<em>cin>>n;</em>

<em>for(int x = 0; x <n;x++)</em>

<em>{</em>

<em> cout<<”Enter test score :” + (x+1) ;</em>

<em> cin>>arrtestscore[x];</em>

<em> count<<”Enter the respective weight:”;</em>

<em> cin>>arrweight[x];</em>

<em>}</em>

<em>for (int i=0; i<n;i++)</em>

<em>{</em>

<em> weightedavg = weightedavg + (arrtestscore[i] * arrweight[i])</em>

<em>}</em>

<em>cout<<”weighted average = “ <<weightedavg; </em>

3 0
3 years ago
The factors of power of device
LUCKY_DIMON [66]

Answer:

tfopod

Explanation:

5 0
2 years ago
I wish we could visit Paris for the holidays into exclamatory​
shusha [124]

Answer:

wdym

Explanation:

3 0
3 years ago
Read 2 more answers
Other questions:
  • A network administrator is required to upgrade wireless access to end users in a building. To provide data rates up to 1.3 Gb/s
    12·1 answer
  • If anybody knows what does this mean I will answer any questions for you and plz answer this right plz what does that envelope w
    5·2 answers
  • The Change Speed command in Audacity lets you change which two things about a track at the same time?
    9·1 answer
  • What tasks does google do?
    5·1 answer
  • During a night flight, you observe a steady red light and a flashing red light ahead and at the same altitude. What is the gener
    11·1 answer
  • Determine the “answer” to the formula according to the spreadsheet below:<br><br> =A3 + B4 + D2.
    15·1 answer
  • What is the meaning of 4 8 15 16 23 42?
    14·1 answer
  • How was the addition of an improvement over early web design?
    11·1 answer
  • Using the Impress program, you can add multimedia files, including audio, image, and video files, to the presentation
    13·2 answers
  • Due TODAY!!! Can someone please help me!!!
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!