subject

1. Write a function called sum_arrays that takes two lists of the same length and returns a list where each element is the sum of the elements at that index in the original list. The function should return the empty list if the parameters are not the same size Sample Run 1:
a = [1, 2, 3, 4, 5]
b = [10, 20, 30, 40, 50]
print(sum_arrays(a, b))

Should output:
[11, 22, 33, 44, 55]

Sample Run 2:
a = [1, 2, 3, 4, 5]
b = [10, 20, 30, 40, 50, 60]
print(sum_arrays(a, b))

Should output:
[]

2. Write a function called replace_elem that takes an array and two values and uses the simple search algorithm to replace all instances of the first value with the second value
Sample Run 1:
a = [7, 4, 10, 3, 7, 2, 4, 5]
print(replace_elem(a, 4, 6))

Should output:
[7, 6, 10, 3, 7, 2, 6, 5]

Sample Run 2:
a = [7, 3, 10, 3, 7, 2, 9, 5]
print(replace_elem(a, 4, 6))

Should output:
[7, 3, 10, 3, 7, 2, 9, 5]

hel plz in python

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:00
Which one of the following would administrators use to connect to a remote server securely for administration? a. telnetb. secure file transfer protocol (sftp)c. secure copy (scp)d. secure shell (ssh)
Answers: 1
question
Computers and Technology, 23.06.2019 12:00
3. when you right-click a linked spreadsheet object, what commands do you choose to activate the excel features? a. linked worksheet object > edit b. edit data > edit data c. linked spreadsheet > edit d. object > edit data
Answers: 2
question
Computers and Technology, 23.06.2019 14:00
Technician a says that with self-adjusting clutch systems, the release bearing constantly rotates. technician b says that the ball bearing portion of the release bearing should be lubricated with high-temperature grease during routine maintenance. which technician is correct?
Answers: 2
question
Computers and Technology, 23.06.2019 17:00
The camera still is bad even with the new iphone xr and especially in low light it is even worst because you can see the pixels more if its in low light. if all you apple customers want apple to fix this then lets fill there feedback with complaints about the can apple do to fix this issue?
Answers: 1
You know the right answer?
1. Write a function called sum_arrays that takes two lists of the same length and returns a list whe...
Questions
question
Mathematics, 03.02.2021 17:00
question
Mathematics, 03.02.2021 17:00
question
Biology, 03.02.2021 17:00
question
Mathematics, 03.02.2021 17:10
question
English, 03.02.2021 17:10
Questions on the website: 13722359