How to use classmethod for a combination of an instance and static method in Python

1 Answer

0 votes
class Test:
    @classmethod
    def show(cls, name):
        print(name)

Test.show("Gandalf")

b = Test()
b.show("Hugo")


'''
run:
 
Gandalf
Hugo

'''

 



answered Nov 17, 2018 by avibootz
...