Topic List | Page List: 1 |
---|---|
Topic | ITT: Learning Python |
SomeLikeItHoth 11/22/21 6:59:05 AM #428: | @toyota Ahh! Really wish I would have seen this earlier so I could ask you some questions. It has been a while since I've worked with Classes, and I'm a little confused by what it is exactly you're trying to do. But from your second photo on the bottom (and I may be wrong), it seems like you're trying to assign the admin class the entirety of the privilege class. There's a few things that stick out to me but I may be misunderstanding your code as you only posted a snipet. https://www.reddit.com/r/learnpython/comments/q6pc3j/understanding_self_in_python/hgdbrbw/ I'm not sure if this is what you're looking for but try this https://stackoverflow.com/questions/51233767/init-missing-1-required-positional-argument-python3?noredirect=1&lq=1 And I also found this. https://stackoverflow.com/questions/69950513/python-typeerror-init-missing-1-required-positional-argument-privilege See what those people did and see if it helps. It's from a few years ago but the syntax should be similar. I also highly suggest reading up on python OOP programming. https://www.youtube.com/playlist?list=PL-osiE80TeTsqhIuOqKhwlXsIBIdSeYtc That mini series helped me understand it a lot. If you're still having trouble then post your entire code so I can copy it into my terminal and I'll see if I can figure it out. I can tell you that I have not seen this syntax used before self.battery = Battery() so that part does confuse me. What source are you reading from? --- FAM FOREVER. ... Copied to Clipboard! |
Topic List | Page List: 1 |