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
kolezko [41]
1 year ago
8

Help debugging line 7 type error more arguments (5) than expected (1)

Computers and Technology
1 answer:
kolezko [41]1 year ago
3 0

Answer:

import random

score = 0

for i in range(5):

   num1 = random.randint(1, 100)

   num2 = random.randint(1, 100)

   prompt = "What is " + str(num1) + "+" + str(num2) + "?"

   answer = int(input(prompt))

   result = (num1, num2)

   if answer == result:

       print("Well done!")

       score += 1

   else:

       print("incorrect")

print("Your score was", score)

Explanation:

Your error is on <em>line 7</em>, where you are providing multiple arguments to the input function, instead of 1.

One way to solve this is to create a variable prompt and concatenate all strings and variables within that variable to use for the input.

You might be interested in
The process of identifying and eliminating bugs in a software program is most generally called reproducing the problem. diagnosi
sergij07 [2.7K]
The correct answer is Option C

debugging
3 0
3 years ago
Store shelves are empty during periods of Excess Demand. What is another term for Excess Demand?
Sunny_sXe [5.5K]
The answer is B, Shortage
6 0
3 years ago
Write a statement that declares a prototype for a function printArray, which has two parameters. The first parameter is an array
slamgirl [31]

Answer:

The prototype for the function is written below:-

void printArray(int [],int);

Explanation:

The prototype of the function is written above.Since the function does not return a value so it has to be of type void.Then following is the name of the function.Following that the arguments in the parenthesis.We need not to provide the name of the arguments we just have to define it's type.So for the array we have to just write int [] and for integer variable just int.

8 0
3 years ago
Which statement best describes a social impact of computing on the world?
DiKsa [7]

Answer: Smartphones have changed the way people communicate through text messages and emojis.

Explanation:

it would only make sense that this is the correct answer because globally smartphones are used for communication, considering the fact that we dont tend to write letters to people across the country as our main source of communication, or in a different continent all together. The steady growth of technology has clearly made getting in touch with people of all nations much easier.

3 0
3 years ago
Please help me please i really need helpp so i can pass
Alchen [17]

Answer:

Piezoelectric gauge is used to convert charge into measureable electric signal.

Universal serial bus interface allows a computer and flash drive to exchange information.

Analytical balance is used to measure mass

Ultrasonic flow sensors measure the seed of water using ultrasonic waves.

Explanation:

Analytical balance is used to measure mass. An analytical balance is a device that can measure the mass of an object  accurately. It can also measure very small amount of mass with a range between 0.1mg - 0.01mg.

Universal serial bus interface allows a computer and flash drive to exchange information. A Universal Serial Bus (USB) is an interface that allows communication between peripheral devices and a computer. It connects peripheral devices such as mouse, keyboards, printers, scanners, external hard drives and flash drives with the computer.

Piezoelectric gauge is used to convert charge into measureable electric signal. A piezoelectric gauge has a piezoelectric sensor that uses piezoelectric effect to measure changes in pressure, temperature, force and convert these changes into electrical charge.

Ultrasonic flow sensors measure the speed of flowing liquid using ultrasonic waves. It uses sound waves to determine the speed of the liquid.

7 0
3 years ago
Other questions:
  • WILL MARK BRAILIEST IF ANSWERED FAST!!!
    8·1 answer
  • 7. Which innovation in video games do you think has been most significant? Include at least one way that innovation affects the
    6·1 answer
  • Assume the method doSomething has been defined as follows: public static void doSomething (int[] values, int p1, int p2) { int t
    6·1 answer
  • Nina is 12 years old. She has just changed her password and wants to make sure she has it in case of
    15·2 answers
  • Micah may be able to repeat the last few digits in a phone number even if he was not paying attention. Because this is auditory
    13·1 answer
  • Give the name of vessel which contains the maximum amount of urea a few hours after a rich meal​
    9·1 answer
  • The first form of the rocket is believed have been developed in _?
    14·2 answers
  • I need help with this question!!
    8·1 answer
  • New friends??? if you want to be my new friend go follow my gram
    7·2 answers
  • A column does not consist of
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!