Skip to content

Instantly share code, notes, and snippets.

@JohnsonLuu
Created June 2, 2020 16:32
Show Gist options
  • Save JohnsonLuu/3f84a3bbbe0f52aee8c96921aa8663f4 to your computer and use it in GitHub Desktop.
Save JohnsonLuu/3f84a3bbbe0f52aee8c96921aa8663f4 to your computer and use it in GitHub Desktop.
"""
Create a function called append_size that has one parameter named lst.
The function should append the size of lst (inclusive) to the end of lst. The function should then return this new list.
For example, if lst was [23, 42, 108], the function should return [23, 42, 108, 3] because the size of lst was originally 3.
"""
#Write your function here
def append_size(lst):
lst.append(len(lst))
return lst
#Uncomment the line below when your function is done
print(append_size([23, 42, 108]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment