Which method will be executed first | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Which method will be executed first

class Sample: @staticmethod def sample(self): return("static method") @classmethod def sample(self): return("class method") print(Sample.sample)

14th Oct 2018, 5:12 PM
Rakesh Kumar N
Rakesh Kumar N - avatar
1 Answer
+ 1
only the class method will be executed because it was declared last.
14th Oct 2018, 5:56 PM
Ulisses Cruz
Ulisses Cruz - avatar