staticmethod()

staticmethod to get static method for a given functions.

By using classmethod(), we work with class , whereas staticmethod() has nothing to do with class.

Example:

class animals():
    def __init__(self,name,height):
        self.name= name
        self.height=height
    
    def legs(no_legs):
        print("legs: ",no_legs) 
animals.legs=staticmethod(animals.legs)        
animals.legs(4)
Output
legs : 4

Using isinstance()

By using isinstance() we can check if the object is instance of the class or not.

All Built in Functions in Python locals() dir() ord()
Subscribe to our YouTube Channel here


Subscribe

* indicates required
Subscribe to plus2net

    plus2net.com



    Post your comments , suggestion , error , requirements etc here





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