callable()

callable() checking object callable or not

Returns Booleans, True if callable , False otherwise.
a=5
x="hi"
my_list=['One','Two','Three']
print(callable(a)) # False
print(callable(x)) # False
print(callable(my_list)) # False 
All above objects are not Callable. Using Class and Objects
class student_kit():
    #instance attributes
    def __init__(self,name):
        self.name= name
        
Alex=student_kit('Alex')  # object declaration
print(callable(student_kit)) # True
print(callable(Alex)) # False , object is not callable
#Alex()   # this will generate error 
The last line will generate error like this.
TypeError: 'student_kit' object is not callable
The class student_kit is callable, the object Alex is not cllable.
All Built in Functions in Python bytes()


plus2net.com



Post your comments , suggestion , error , requirements etc here




We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
©2000-2020 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer