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
What is the output?
Pepsi [2]

Answer:

The answer is false

Explanation:

The string isalpha() returns True if all the characters are letters and the string has at least one character.

7 0
3 years ago
Enter key is also known as Return key. (True or false)
Amanda [17]

Answer:

I think false

hope it helps

6 0
3 years ago
Read 2 more answers
Which of the following terms is associated with instant messaging?
Lerok [7]
D.

Texting is associated with instant messaging
3 0
3 years ago
Project 15A - Math Application
vovikov84 [41]

Answer:

A simple php code for the following is given below:

Explanation:

interface Calculate {

 public function area($lenght,$width);

 public function perimeter($length,$width);

 public function surfaceArea($length_side_1,$length_side_2);

 public funcction volume($length, $width, $height):

}

interface Calculate2 {

 public function area($raidus);

 public function perimeter($radius);

 public function surfaceArea($radius);

 public funcction volume($radius):

}

Class Mian{

 

width=please Enter the value of width

height=please Enterr the value of height

length=please enter the value of length

lenght2=please enter the value of lenth of side 2

ridus= please enter the value of radius

    Circle = new circle()

    Rectangle = new rectangle()

}

Class Circle implements Calculate2{

 

public function area(){

area= pi*r

return area

}

public function perimeter(){

perimeter=2*pi*r

return perimeter

}

public function surfaceArea(){

surfacearea= pi*r*r

}

public function volume(){}

          area=area()

   volume=area*height

      return volume

}

Class Rectangle implements Calculate{

 

public function area(lenght,width){

 area= length * width

 return area

}

public function perimeter(lenght,width){

          perimenter=2(lenght+width)

          return perimeter

}

public function surfaceArea(length_side_1, withd right place){}

       surface_area 2*length_side_1  f*  length_side_2_

public function volume(){}

public surface volume(length,width,height)

 volume= length * width * height  

 return volume

}

7 0
3 years ago
Which type of attack involves changing the boot order on a PC so that the hacker can gain access to the computer by bypassing th
mariarad [96]

The type of attack that involves changing the boot order on a PC so that the hacker can gain access to the computer by bypassing is known as Physical attack.

<h3>What is physical attack in computer security?</h3>

In a physical attack, this is known to be where an attacker is said to have physical access to any kind of physical asset in the area of the infrastructure system so that they can damage it, disable it, or others.

Note that based on the above, The type of attack that involves changing the boot order on a PC so that the hacker can gain access to the computer by bypassing is known as Physical attack.

Learn more about Physical attack from

brainly.com/question/11609218

#SPJ1

8 0
2 years ago
Other questions:
  • The ________ program displays graphics and loading screens during the boot process.
    8·1 answer
  • When we consider data quality, what are the differences among validity, reliability, and representativeness? How can you know th
    8·1 answer
  • A domain name points to a specific internet address known as a? A. Domain name B. User name C. URL D. IP address
    12·1 answer
  • Write the java statement to creat an object mp4 class digital​
    8·1 answer
  • From the following list choose all the tasks an operating system performs.
    5·2 answers
  • In theory, a(n) _____ can be an independent centralized database management system with proper interfaces to support remote acce
    15·1 answer
  • Why are some geo satellites not usually used for transmitting tcp/ip information?
    5·1 answer
  • How does computer science play a role in art?
    6·1 answer
  • When LDAP traffic is made secure by using Secure Sockets Layer (SSL) or Transport Layer Security (TLS), what is this process cal
    9·1 answer
  • From the introductory conversation chip and anna shared, which elements mentioned might suggest the use of case tools?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!