1#------------------------------------
2#CLASS
3#------------------------------------
4class Student:
5 def __init__(self):
6 self.name = None
7
8 def set_name(self, word):
9 self.name = word
10 return self.get_name()
11
12 def get_name(self):
13 return self.name
14
15#------------------------------------
16# USAGE:
17#------------------------------------
18
19a = Student()
20print(a.set_name("Hello"))
1# Add the argument ".self" before your function's name --> line 12
2
3class ThisClass:
4 def __init__(self):
5 self.a_random_arg = a_random_arg
6
7 def FirstDef(self):
8 [Here my function]
9
10 def SecondDef(self):
11 if self.FirsDef:
12 [following]