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
A related database stores data in the form of______
avanturin [10]

Answer:

Lists.

Explanation:

A relational database stores data in the form of lists.

6 0
2 years ago
I forgot to tell it’s on Roblox for those who play and wanted to be friends and new ppl username is mosarider489
never [62]

Answer:.

Explanation:

.

8 0
3 years ago
Read 2 more answers
Although heart rate increases and decrease depending upon activity level on average a typical person heart rate is about _____ b
ExtremeBDS [4]

Answer:

72

The normal resting heart rate is between 70 and 100 bpm.

4 0
3 years ago
Assuming outFile is a file stream object and number is a variable, which statement writes the contents of number to the file ass
professor190 [17]

Answer:

Its outfile<<number.

However, before this we need to write

outfile.open("xyz.txt", ios;;out)

outfile<<number

And this code will do what is required in the question. This is going to write the number's content to the xyz.txt file which is the file associated with the outfile.

And remember this is in C++. And C++ is a imperative oriented programming language. Undoubtedly, Python and R are fully object oriented programming languages.

Explanation:

The answer is self explanatory.

7 0
3 years ago
Universal Containers is tracking the interviewer's ratings of candidate in Salesforce. They would like to easily link the Candid
uranmaximum [27]

Answer:

Hierarchical is scenario is used to between condition and ratings.

Explanation:

Master   -details its open up all details of the candidate and his rating to Universal Containers is tracking by interviewer ratings. where they are no classified. Just data collection.

Lookup:- where it fetches all details and further analysis will be a big task.

Search  :- it is a just search where relevant information based on queries.

Hierarchical;- it is further classified and it is very to do analysis and takes decisions.

Since it is classified further drill down is possible and make a good analysis report can be made.

3 0
3 years ago
Other questions:
  • Give big-O estimate for the number of operations (multiplication or addition) used in the following algorithm segment (ignore co
    15·1 answer
  • What field in a TCP segment is used to determine if an arriving data unit exactly matches the data unit sent by the source?]
    10·1 answer
  • If you place a semicolon after the test expression in a while loop, it is assumed to be a(n) ________. a. pre-test loop b. post-
    9·1 answer
  • Why is population composition by age important give reason​
    13·1 answer
  • When the code that follows is executed, a message is displayed if the value the user entersvar userEntry = (prompt("Enter cost:"
    11·1 answer
  • You are given a 5-letter word (for example, abcde). Write a C-Program which outputs all possible unique 5 letter permutations of
    13·1 answer
  • Does trend in computing important for organization management?​
    8·1 answer
  • Select the correct answer from each drop-down menu.
    7·1 answer
  • The international system of units is very important to our worldwide science community because it is easier for scientists to sh
    12·1 answer
  • By definition, what is the process of reducing security exposure and tightening security controls?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!