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

How to delete a file or folder?

936


What is set when we have to use?

944


How can I execute arbitrary python statements from c?

1007


What is the difference between del() and remove() methods of the list?

916


Explain split() methods of "re" module in python?

1016


In python, how can you generate random numbers?

988


Write a program in python to produce star triangle.

904


Calling an external command in python?

918


What is python software?

882


Where we can use else block in python programming?

844


Which is better java or python?

1025


How is numpy different from scipy?

951


How to find the index of an item given a list containing it in python?

871


How to install a package and import?

942


What is the cost of python certification?

1013