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]
2 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]2 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
Privacy, anonymity, and freedom of expression are all interrelated.
Andre45 [30]

Answer:

Criminals (terrorists).

Explanation:

6 0
2 years ago
Create a program that allows the user to input a list of first names into one array and last names into a parallel array. Input
natita [175]

Answer:

The program in Python is as follows:

firstName = []

lastName = []

while True:

   fName = input("First Name: ")

   lName = input("Last Name: (Enter to quit): ")

   if not lName:

       break

   firstName.append(fName)

   lastName.append(lName)

for i in range(len(firstName)):

   print(firstName[i] . lower()+"."+lastName[i] . lower()+" mycollege . edu")

Explanation:

See attachment for complete source file where comments are used as explanation

Download txt
8 0
3 years ago
All organizations need good quality cybersecurity to ensure _____. Select 4 options.
vova2212 [387]

Answer:

option 1

Explanation:

it is because they need better security for operational

7 0
2 years ago
Read 2 more answers
If a user wished to insert a triangle or a callout figure in a document, he or she should select the _____ option.
Vlada [557]
The Insert Tab option

You can add a shape your word, excel or PowerPoint document to make a drawing. To do this in MS Word, click on the Insert tab, and in the illustration group, click on the shapes option. Click the shapes or callouts that you would like to insert and then drag to place the shape anywhere in the document.






4 0
3 years ago
An administrator has just added a new update to the WSUS server and she wants to test the update to the test group. Which of the
DENIUS [597]

Answer:

a. gpupdate /force

Explanation:

Based on the information provided within the question it can be said that if the administrator does not want to wait she can use the command gpupdate /force. This command allows the individual to update both the local Group Policy settings and Active Directory-based settings. This the force tag makes it so that the policy is immediately update.

6 0
3 years ago
Other questions:
  • How many rows and columns does ms-excel 2007 have???
    10·1 answer
  • What operating system type uses icons to represent programs
    9·2 answers
  • Megan has written the following rough draft for her assignment. Choose the correct way to complete each sentence. Sarah is creat
    13·1 answer
  • In C, developers may access arrays via bracketed syntax like Java or by using * dereferencing notation. The following assignment
    5·1 answer
  • The part of the computer that contains the brain or the Central Park nursing unit is also known as
    10·1 answer
  • How do the principles behind the Agile Manifesto suggest approaching architecture?A. Architecture emergesB. Architecture is not
    10·1 answer
  • Which of the following should you do if your accelerator is stuck? A. Pump your brakes to build fluid pressure. B. Shift to Neut
    14·2 answers
  • If I'm screen sharing and I plug in a HDMI, will it screen share what the HDMI is plugged into, and can you talk at the same tim
    11·1 answer
  • Which type of loan is based on financial need
    6·1 answer
  • The iso 14001:2004 standards require documentation of a firm's environmental program. Which component requires a plan to improve
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!