__call__() python
class Foo:
def __call__(self, a, b, c):
# ...
x = Foo()
x(1, 2, 3) # __call__
__call__() python
class Foo:
def __call__(self, a, b, c):
# ...
x = Foo()
x(1, 2, 3) # __call__
python call function in class
#------------------------------------
#CLASS
#------------------------------------
class Student:
def __init__(self):
self.name = None
def set_name(self, word):
self.name = word
return self.get_name()
def get_name(self):
return self.name
#------------------------------------
# USAGE:
#------------------------------------
a = Student()
print(a.set_name("Hello"))
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us