-
-
Save ArunkumarRamanan/ec0a503a73ffc39c9dced30df56e6b90 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