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
Nuetrik [128]
3 years ago
8

Given two lists of integers, write a function multLists(list1, list2) that multiplies each value of the list1 by the values of l

ist2 and returns list1 with it's updated values. The lists will be obtained for you, just write the function and print the result.
Computers and Technology
1 answer:
Fynjy0 [20]3 years ago
3 0

Answer:

FIRST SOLUTION

def multLists(list1,list2):

   for i in range(len(list1)):

       list1.append(list1[i]*list2[i])

   return list1

SECOND SOLUTION

def multLists(list1,list2):

   newlist = [ ]

   for i in range(len(list1)):

       newlist.append(list1[i]*list2[i])

   return newlist

Explanation:

First we define the function and call it MultLists. Then using a for statement, we loop through the list the number of times that is equivalent to the length of the list1. In the first solution, we append the element-wise multiplication in the two list and append this to list1. The return of the first solution, is list1 which contains list1 in addition to the product of the elements from list1 and list2

In the second solution, we create a new list, and using the append function, we populate it with the values of the element-wise multiplication from the two lists. The return of the second solution, is a new containing only to the product of the elements from list1 and list2

You might be interested in
Ricardo twists his ankle at work but does not immediately realize that he is injured because his ankle is not sore or swollen, a
Alex Ar [27]

yes, the employer DID misuse a disciplinary program against Ricardo for reporting an injury, because it was not an injury at that time, Ricardo reported the injury when it became an injury. he did nothing wrong. if he was in not in pain, he sustained on injury. until the injury devoloped from twisting his ankle.


hope this helps!

3 0
3 years ago
Betrand Meyer developed the ______ programming language which is not type-safe because it violates the law of contravariance.
frozen [14]

Answer:Eiffel programming

Explanation: Eiffel programming language was base on object-oriented pattern and developed by Betrand Meyer in 1986.This helps in creating the software modules that can be used again and is reliable as well.

This language was not considered as type safe because it could execute the operation on any particular object which is considered invalid on it.This language lacks about ensuring the program that are written are well defined or not.

4 0
3 years ago
You have a large TCP/IP network and want to keep a host's real time clock synchronized. What protocol should you use?
sweet-ann [11.9K]

Answer: NTP ( Network time protocol)

Explanation:

Network time protocol is the time server which basically works in the TCP and IP network. It rely on the UDP ( User data-gram protocol) at port 123.

NTP server is the dedicated network time protocol devices which basically use for synchronize the network.

It is basically design to synchronize the clock in the computer and across the internet network and local area network. NTP server basically maintain the quality of the reference clock time.

4 0
3 years ago
PLEASE HELP! I accidently looked up a link, and now this same link keeps popping up everywhere, how do I stop this!?!? please he
Black_prince [1.1K]

Answer:

Try restarting your phone

Explanation:

8 0
2 years ago
Read 2 more answers
What should you include in a persuasive speech
Vlad [161]

Answer:

Come up with a controversial topic, one that make your listeners think

Research the topic thoroughly that you have chosen

Understand the perspective of your audience. Keep your goal in mind. You are trying to persuade the audience to do or believe something .

7 0
3 years ago
Other questions:
  • In the two-level directory, if a user refers to a particular file then__________________ Select one: a. only his/her own UFD (us
    7·1 answer
  • Websites using www showed up on the internet for the first time in -992
    9·1 answer
  • Hackers who gain control over several computers can organize them into a client-server network known as a(n) __________ . This n
    7·1 answer
  • Why would "ExpirationDate” be a poor choice as a primary key?
    11·1 answer
  • Which approach to knowledge management capitalizes on tacit knowledge and requires heavy IT investment?
    7·1 answer
  • Similarites between hardware and software
    9·1 answer
  • ________ are chunks of software - installed on one's computer, tablet, or smartphone - that are gateways to games, online resour
    8·1 answer
  • How are switches indirectly involved in ARP poisoning?
    6·1 answer
  • several ways that we commonly use technology today that people couldn't 10 years ago. Are these uses helpful or harmful to socie
    9·1 answer
  • Discuss seven multimedia keys​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!