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
Sladkaya [172]
3 years ago
9

PLEASE HELP WITH THIS "PROJECT"

Computers and Technology
1 answer:
Readme [11.4K]3 years ago
7 0

numA = [4, 1, 6, 10, 2, 3, 7, 9, 11, 12, 5, 8]

numB = [2, 12, 10, 11, 1, 3, 7, 9, 4, 8, 5, 6]

operation = input("Are you adding or multiplying? (a/m)")

i = 0

if operation == "a":

   while i < len(numA):

       try:

           answer = int(input("{} + {} = ".format(numA[i], numB[i])))

           if answer == numA[i] + numB[i]:

               print("You're correct!")

           else:

               print("You're wrong! The correct answer is {}".format(numA[i] + numB[i]))

           i+=1

       except ValueError:

           print("Please enter a number!")

if operation == "m":

   while i < len(numB):

       try:

           answer = int(input("{} * {} = ".format(numA[i], numB[i])))

           if answer == numA[i]*numB[i]:

               print("You're correct!")

           else:

               print("You're wrong! The correct answer is {}".format(numA[i]*numB[i]))

           i+=1

       except ValueError:

           print("Please enter a number!")

The type of error handling we perform is ValueError handling. Instead of getting an exception when the user enters a letter when they try to answer a math problem, we tell the user to enter a number.

I hope this helps!

You might be interested in
While inserting images, the Picture command is usually used to insert photos from a digital camera, and the Clip Art command is
Alik [6]
To insert pics or gifs or audio from the pc stored on default
8 0
3 years ago
Read 2 more answers
In which of the following careers must one learn and use programming languages?
EleoNora [17]

Answer: any job that has programming in it

8 0
3 years ago
What makes this information systems environment unique? (3 points)
QveST [7]

Information technologies are unique not just because of their growing use in decision-making and knowledge management systems, important as that is. Their use has also yielded significant improvements in the efficiency of energy and materials use.

6 0
3 years ago
What is the difference between ordered list and unordered list?
VladimirAG [237]

Answer:

In an ordered list, each item is displayed along with the numbers or letters instead of bullets

In an unordered list, each item is displayed with a bullet.

5 0
3 years ago
How do I use this without the spring?
poizon [28]

Answer:

put a spring in

Explanation:

duuuuuuuu

cy

6 0
3 years ago
Other questions:
  • It's inventiveness, uncertainty futuristic ideas typically deal with science and technology.what is it?
    14·1 answer
  • If some1 emails u and u want to know who it was how do u find that out
    10·2 answers
  • Write a C++ program that stores the integers 50 and 100 in variables and stores the sum of these two in a variable named total.
    11·1 answer
  • Files exist on ____ storage devices, such as hard disks, dvds, usb drives, and reels of magnetic tape.
    11·1 answer
  • Jenny, a programmer, uses Microsoft Excel 2016 to generate data required for the programs she develops. She uses various functio
    10·1 answer
  • modified true or false analyze each statement then write technical the statement is true the statement is false underline the wo
    6·1 answer
  • To override a method in a subclass, the method must be defined in the subclass using the same signature and compatible return ty
    12·1 answer
  • UserInp = input("Did you like the story?")
    7·1 answer
  • Write a program that reads a list of integers into a vector, and outputs the two smallest integers in the list, in ascending ord
    5·1 answer
  • What is anequality query​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!