Answer to Question #309589 in Python for lilviezz

Question #309589

Write a function named add_value that has a single parameter. This parameter will be a list/array. Your function needs to add the value 21 to the parameter after its last entry. Because lists and arrays are mutable, your function does not have to return a value.


1
Expert's answer
2022-03-11T02:26:18-0500
def add_value(array):
    array.append(21)

A = [4, 5, 6, 5, 3, 2, 8, 0, 4, 6, 7, 8, 4, 5, 8]
print(A)
add_value(A)
print()
print("Add the value 21:")
print(A)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS