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
GREYUIT [131]
2 years ago
5

Write a python program that takes two lists as input from the user, multiplies the index wise elements of the two lists and adds

it to a new variable. While doing the program you should handle the following exceptions: Return an exception if an element in a list is not a number stating “The list has some non number values”. Return an exception if there is an index out of bound stating “Index out of bound”. ============================= Example 1: Input: list_one = [1, a, 2, 4] list_two =[5, 6, 7, 8] Output: The list has some non number values
Computers and Technology
1 answer:
nevsk [136]2 years ago
3 0

Answer:

list_one=[]

list_two=[]

list_three=[]

str1=input("list_one:")

for i in str1:

   if i.isdigit():

       i=int(i)

       list_one.append(i)

   elif i.isalpha():

       list_one.append(i)

str2=input("list_two:")

for i in str2:

   if i.isdigit():

       i=int(i)

       list_two.append(i)

   elif i.isalpha():

       list_two.append(i)

print(list_one)

print(list_two)

if len(list_one)==len(list_two):

   for i in range(len(list_one)):

       multiply=list_one[i]*list_two[i]

       add=str(multiply)

       list_three.append(add)

else:

   print("Index out of bound")

n=0

for i in list_three:

   if i.isdigit():

           n+=1

   else:

       print("The list has some non number values")

print(list_three)

You might be interested in
If i tell you my email will you give me a joke
pentagon [3]

Answer:

i don't want ur email but here's a joke more like a riddle: I speak without a mouth and hear without ears. I have no body, but I come alive with wind. What am I?

answer an echo

Explanation:

5 0
3 years ago
Software that people commonly use in the workplace to make their lives easier is called?
emmasim [6.3K]
Answer: System Software

7 0
3 years ago
Jargon is:
pentagon [3]

Answer: The answer would be "B" - language that includes terms that only a select few can understand

Explanation:

3 0
3 years ago
Read 2 more answers
Public static void prefixmerge(customer[] list1, customer[] list2, customer[] result {
White raven [17]
I can't get what do you need, but I guess it's a part of java code. I can explain what it means. It's used to unite two rising sorted arrays which are list1 and list2. The result is stored in result array. I suggest you to clearly explain your task as it's difficult to give you correct answer.
8 0
4 years ago
___ is two or more connected computers
quester [9]
NETWORK is two or more computers connected together
8 0
3 years ago
Other questions:
  • What is the term for the process of gathering information through images taken at a distance?
    13·1 answer
  • Why is the stateless nature of the internet a problem for shopping cart software? g?
    5·2 answers
  • Match the parts of the website address with its correct explanation. http://www.usa.gov/Agencies/federal.shtml
    10·2 answers
  • Identify which statement explains why a programmer would break a logic problem into steps.
    13·2 answers
  • The ____ developed numerical methods for generating square roots, multiplication tables, and trigonometric tables used by early
    12·1 answer
  • c++ Write a statement that increments (adds 1 to) one and only one of these five variables: reverseDrivers parkedDrivers slowDri
    6·1 answer
  • How do you think computers have helped to improve documentation, support and services within the healthcare industry.
    5·2 answers
  • State four features of information​
    5·1 answer
  • Anyone know how to delete it in my laptop
    10·1 answer
  • A ________ is a device used to illegally capture the data stored on the magnetic stripe of an ATM card, credit card, or debit ca
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!