- 1
Explain this piece of code please 🙏🙏🙏
class BirbLang: def __init__(self, program): self.program = program @staticmethod
2 odpowiedzi
+ 6
Hello! Seems you found my BirbLang code 😅
If you're referring to the contents of the __init__() function, all it really does is once the class gets initialized, the variable self.program within the class will be set to whatever value is entered through the program parameter.
For example, if the following line appears somewhere in the code:
x = BirbLang(code)
whatever value is held within code will be given to self.program for the instance of the class stored in x.
+ 1
There is nothing to explain, it's incomplete, and it does nothing.
Everything is explained in the course, where exactly do you have a confusion ?