Question from the Python test

Write a Python function that returns a copy of anotherlist with number appended to the end.

Hard

What can be said about the my_function function?

def my_function(number, otherlist=[]):
   """Returns a copy of anotherlist with number appended to the end"""
    otherlist.append( number )
    return anotherlist[:]
Author: Antoine BrennerStatus: PublishedQuestion passed 1710 times
Edit
0
Community Evaluations
developer avatar
Victor
11/10/2021
Impossible de voir correctement l'image sur téléphone
developer avatar
Vincent Cotro
18/10/2021
Bonjour Victor, la question a été réécrite en markdown. Merci pour ton retour.
developer avatar
Auteur anonyme
21/03/2022
Bonjour. Je pense qu'il y a une typo: autreliste.apprend -> autreliste.append
developer avatar
julide
20/03/2023
faut vraiment avoir des yeux puissants pour voir le typo!!