Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Explain the difference between `@staticmethod` and `@classmethod`.

Answer Posted / nashiinformaticssolutions

`@staticmethod` is used for methods that don’t require access to the instance (`self`) or class (`cls`). `@classmethod` is used when a method needs access to the class (`cls`), but not the instance (`self`).

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the output of this line?

905


How does python handle compile-time and run-time code checking?

854


Give an example of shuffle() method?

757


Can I use Python instead of PHP?

915


How to send a object and its value to the garbage collection?

762


Explain relational operators in python?

860


How do I get a list of all files (and directories) in a given directory in Python?

813


How are data types defined in python?

832


What is anagram in python?

780


What is the difference between uuid and guid?

913


How to compare two lists in python?

814


What is the purpose of the pythonpath environment variable?

886


What does kwargs mean?

761


Are uuids sequential?

716


Which linux is best for python programming?

935