-
-
Save Kjeanclaude/c10f8295d6cabfe7ca302c0166b4b114 to your computer and use it in GitHub Desktop.
delete_first
This file contains hidden or 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 delete_first(self): | |
deleted = self.head | |
if self.head: | |
self.head = self.head.next | |
deleted.next = None | |
return deleted |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment