Created
June 2, 2020 16:32
-
-
Save JohnsonLuu/3f84a3bbbe0f52aee8c96921aa8663f4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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