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]
3 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]3 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
I need help with this problem plsssssssssssssss
xeze [42]

Answer: Form

Explanation:

Bioshock was primarily an Art Deco style type game but in thi picture we see a person burned on fire so it's like a 3D aspect of the game which makes it form.

6 0
4 years ago
Describe the functions of ALU, resisters, CU, BIU, Cache and FPU.
stich3 [128]

Answer:

ALU :An arithmetic logic unit (ALU) is a digital circuit used to perform calculations and logic operations

Registers:register holds the address of memory where CPU wants to read or write data.

CU:The control unit (CU) is a component of a computer's central processing unit (CPU) that directs the operation of the processor.

BIU:BIU takes care of all data and addresses transfers on the buses for the EU like sending addresses, fetching instructions from the memory, reading data from the ports and the memory as well as writing data to the ports and the memory.

Cache:Cache is used to temporarily hold instructions and data that the CPU is likely to reuse.

FPU:A floating-point unit (FPU, colloquially a math coprocessor) is a part of a computer system specially designed to carry out operations on floating-point numbers.

Explanation:

This is all I can say

5 0
3 years ago
If you have related data stored in multiple tables, create a(n) ________ to produce a pivottable on the combined data.
vladimir1956 [14]
If you have related data stored in multiple tables, create a Data model to<span> produce a pivot table on the combined data.
In computer term, data model refers to how each data are connected to one another and how those connections are being processed within the Sysyem</span>
3 0
4 years ago
How does the post process alert the user if it detects a hardware problem during the post process?
Lesechka [4]
As a Alert down by the bar under where it says start I would think.
6 0
4 years ago
Guys i really need help pleasure?
miskamm [114]

How many copies to print is one of several choices
you can indicate in the print dialog.


7 0
3 years ago
Read 2 more answers
Other questions:
  • What output is produced by the following code fragment int num = 1 max = 20 while num &lt; max?
    7·1 answer
  • Why do computers need to periodically check the dns for websites you have already visited? enter your answer here?
    15·1 answer
  • What output will the look up formula below produce in relation to the following table?
    11·1 answer
  • The opening of the throttle plate can be delayed as long as
    13·1 answer
  • Define the term e-learning​
    5·2 answers
  • For activities with output like below, your output's whitespace (newlines or spaces) must match exactly. See this note. Jump to
    15·1 answer
  • CIST 1122 Project 2 Instructions
    11·1 answer
  • Explain the significance of the loss of direct, hands-on access to business data that end users experienced with the advent of c
    14·1 answer
  • ICT 10
    8·1 answer
  • Given the IPv4 address in CIDR notation 215.200.110.50/25, identify the subnet IDs.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!