Skip to content

Instantly share code, notes, and snippets.

@freelancing-solutions
Created April 17, 2023 10:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save freelancing-solutions/721e3e2b5595e134452fb26a220d60c6 to your computer and use it in GitHub Desktop.
Save freelancing-solutions/721e3e2b5595e134452fb26a220d60c6 to your computer and use it in GitHub Desktop.
it will work just fine mate
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