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
Which of the following enables robots to do things such as understand itself, walk, talk, and develop skills?
zmey [24]

Answer:

self-modeling

Explanation:

Robots, which are man-made machines which mimics the actions of man like walking, talking, rendering assistance are part of the future plans to make the society easier. It was mans' attempt to improve the society but still happens to be work in progress.

For the robots to be able to carryout its function, there is need for it to be self modelling in the sense of initiating and executing the commands which was already programmed into it. <em>For example, telling it to walk will be initiated by him as a command, after processing the command, it will execute it without any other information.</em>

7 0
3 years ago
The image type used for graphics that need smaller sizes with no loss of quality is a ___________.
Novosadov [1.4K]
I believe the answer it TIF 
4 0
3 years ago
Free Response: Efficiency in the Real World This lesson introduced the notion of "efficiency" in programming, and that it might
pochemuha

Answer & Explanation:

Efficiency in the virtual world is closely related to that of the real world. In programming it is how fast an application run and robust(concise and small) it is coded. similarly efficiency is used when also explaining how fast you can manage your time while performing a task (like production). so in terms of similarity we will consider speed but for difference you may have to add other parameters when considering efficiency outside of programming.

4 0
4 years ago
A group of cells is called a<br><br> Excel
arsen [322]

Answer:

Every worksheet is made up of thousands of rectangles, which are called cells. A cell is the intersection of a row and a column. ... You can also select multiple cells at the same time. A group of cells is known as a cell range

8 0
3 years ago
The person or user associated in computer field is called​
marusya05 [52]

Explanation:

A computer programmer, sometimes called a software developer, a programmer or more recently a coder (especially in more informal contexts), is a person who creates computer software.

6 0
3 years ago
Read 2 more answers
Other questions:
  • Implement the function maxLoc(), which returns an iterator at the largest element in a list. template typename list::iterator ma
    14·1 answer
  • Each peripheral device has its own software, called a(n) ____, which contains the detailed instructions required to start that d
    6·1 answer
  • What is the role of the ieee in computer networking and wireless communications?
    14·1 answer
  • Write a program of while loop 1234 get printed 4231
    7·1 answer
  • Assume that the following table is created and stored in your database:
    5·1 answer
  • 100BaseT network uses the TCP/IP protocol suite exclusively, and workstations on your network obtain addresses dynamically from
    6·1 answer
  • What type of chart is good for single series of data​
    15·2 answers
  • The variable named var2 declared above will include an ending NULL character.
    9·1 answer
  • you are teaching a class about basic camera functions like power, basic date/time, menu navigation, and how to properly attach a
    9·1 answer
  • Which of the following is considered a skill?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!