Created
April 17, 2023 10:49
-
-
Save freelancing-solutions/721e3e2b5595e134452fb26a220d60c6 to your computer and use it in GitHub Desktop.
it will work just fine mate
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
def this_works_just_fine(my_list: list[int] = []) -> list[int]: | |
""" | |
This function will remove the first element of a list | |
""" | |
my_list.pop(0) | |
my_list.reverse() | |
return my_list | |
def still_works(): | |
my_list: list[int] = [1, 2, 3, 4, 5] | |
print(this_works_just_fine(my_list)) | |
this_works_just_fine(my_list) | |
print(my_list) | |
print(this_works_just_fine(my_list)) | |
print(this_works_just_fine(my_list)) | |
print(this_works_just_fine(my_list)) | |
# Output | |
# [5, 4, 3, 2] | |
# [2, 3, 4] | |
# [4, 3] | |
# [3] | |
# [] | |
if __name__ == '__main__': | |
still_works() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment