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
Universal Containers has a custom picklist filed with three values on their products. The Admin would like to create a Dynamic B
Agata [3.3K]

Answer:

The Admin should Create a rule with three conditions, each that compares the configuration attribute filed with a static value.

8 0
3 years ago
What part of speech is contend
Amiraneli [1.4K]
Assuming the context, it would be considered a verb.

ie: "She contended to me that I was not acting maturely." 
7 0
3 years ago
A ___ is a mobile device that typically ranges from seven to ten inches in size.
Ber [7]

A tablet computer, or commonly known as tablet,  is a mobile device that typically ranges from seven to ten inches in size. It has mobile operating system and LCD touchscreen display processing circuitry. The touchscreen display is operated by  finger. The tablet has many all of the functionalities of a computer, but not all of them.


3 0
4 years ago
Select the correct answer.
bagirrra123 [75]

Answer:

I think the answer is C

Explanation:

Because if you use context clues for the word CINEMATOGRAPHER, cinema is like scene and lights and tographer is the person who adjusts it

4 0
3 years ago
Which function can you use to abbreviate the lengthy expression, A1+A2+A3+A3...+A19+A20?  MAX COUNT SUM ROUND
Naddika [18.5K]
Which function can you use to abbreviate the lengthy expression, A1+A2+A3+A3...+A19+A20? SUM
6 0
4 years ago
Read 2 more answers
Other questions:
  • You install a SATA hard drive and then turn on the computer for the first time. You access BIOS/UEFI setup and see that the driv
    8·1 answer
  • What is the first step in planning a multi-table query?
    14·1 answer
  • The best way to insert an existing Excel chart into a document is to
    12·2 answers
  • You want to average the numbers in the range b1:b30. you have named this range of cells data and wish to use this range name in
    9·1 answer
  • Which one of the following statements referring to mobile Internet
    5·2 answers
  • Mila received a new DVD player that she is trying to connect to the back of her television by feel alone. The first stage of mem
    11·1 answer
  • To use an ArrayList in your program, you must import:1. the java.collections package2. the java.awt package3. Nothing; the class
    6·1 answer
  • Michael’s team is presenting a robot before their examiners. What do they need which is a definitive description of the final pr
    6·1 answer
  • Como se juega robótica de cokitos
    13·1 answer
  • I really need help please help me
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!