self tag

3 questions


1 answers
126 views
0
What is the difference between writing and not writing self in the class method?

When I made the code in Faicham, they automatically put self on itWhy are you doing this?I wonder what role self plays, so if you take out self, there will be an error.class Test(object): def method_o...


1 answers
146 views
0
What role do __init___ and self play?

I usually speak C language, and sometimes I don't understand Python because it's a habit.What do self and _init__ do in the functions below?Is there any reason why you have to write it down?I think it...

2 years ago

1 answers
157 views
0
I'm now at the stage of scribble. #principled question

[Laughing]Why the variables in the init function once again self.What's the reason for changing it like name = name...?

2 years ago

© 2024 OneMinuteCode. All rights reserved.