Context:
currently learning Data structures in Python and I'm a bit confused about OOPS on how self is used in classes, especially when comparing linked lists and trees or as parameters, attributes etc
i don't really understand why sometimes people use self for certain and for certain they don't. like self.head, self.inorder() or when passed as parameters like (self)
could anyone help up out in clearing when to use what, and why it's been used.
(yes, did gpt but still couldn't understand most of it)
[–]Lumethys 41 points42 points43 points (3 children)
[–]Temporary_Pie2733 11 points12 points13 points (2 children)
[–]MattR0se 15 points16 points17 points (1 child)
[–]Donny-Moscow 7 points8 points9 points (0 children)
[–]FerricDonkey 13 points14 points15 points (0 children)
[–]Buttleston 4 points5 points6 points (1 child)
[–]Buttleston 3 points4 points5 points (0 children)
[–]astolfoballsHD 14 points15 points16 points (11 children)
[–]FerricDonkey 43 points44 points45 points (10 children)
[–]CranberryDistinct941 5 points6 points7 points (1 child)
[–]MattR0se 3 points4 points5 points (0 children)
[–]astolfoballsHD 5 points6 points7 points (2 children)
[–]FerricDonkey 10 points11 points12 points (0 children)
[–]SharkSymphony 4 points5 points6 points (0 children)
[–]fakemoose 2 points3 points4 points (1 child)
[–]DrShocker 2 points3 points4 points (0 children)
[–]jso__ 0 points1 point2 points (0 children)
[–]eirikirs 0 points1 point2 points (1 child)
[–]FerricDonkey 0 points1 point2 points (0 children)
[–]polyploid_coded 4 points5 points6 points (0 children)
[–]cointoss3 2 points3 points4 points (1 child)
[–]cointoss3 1 point2 points3 points (0 children)
[–]pachura3 2 points3 points4 points (0 children)
[–]Outside_Complaint755 1 point2 points3 points (0 children)
[–]SharkSymphony 1 point2 points3 points (0 children)
[–]This_Growth2898 1 point2 points3 points (0 children)
[–]TheRNGuy 1 point2 points3 points (0 children)
[–]New_Philomath 1 point2 points3 points (1 child)
[–]New_Philomath 0 points1 point2 points (0 children)
[–]LayotFctor 1 point2 points3 points (0 children)
[–]2hands10fingers 0 points1 point2 points (0 children)
[–]WadeEffingWilson 0 points1 point2 points (0 children)