---
title: "Method and Function"  
description: "Method and Function"  
author: "Anonymous User"  
published: 2018-06-21  
updated: 2018-06-22  
canonical: https://www.mindstick.com/forum/34534/method-and-function  
category: "python"  
tags: ["python"]  
reading_time: 2 minutes  

---

# Method and Function

What is the [difference between method](https://www.mindstick.com/interview/2444/difference-between-method-and-selector) and [function](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server) in [python](https://www.mindstick.com/articles/75378/simple-yet-useful-tips-when-using-python) ?

## Replies

### Reply by Prakash nidhi Verma

Python [Method](https://www.mindstick.com/forum/166/webservice-method):

A dependent object is associated by method.It may or may not return any data.A method can operate on the data as a instance variables that is contained by the corresponding class.

syntax :

```
class class_name     def method_name () :
        ......
        # method body
        ......
```

Functions:

Function is block of code that is also called by its name. The function can have different parameters or may not have any at all. If any data as a parameters are passed ,It may or may not return any data.Function doesn't deal with class and its instance concept.

syntax :

```
def function_name ( arg1, arg2, ...) :
    ......
    # function body
    ......
```

[Difference](https://www.mindstick.com/articles/157114/good-news-or-bad-news-and-the-difference-is) between method and function :

function and method both look similar. they perform in almost similar way, but the key difference is the concept of Class and Object.Functions can be called only by its name, But methods can’t be called by its name only, we need class by a reference of that class.


---

Original Source: https://www.mindstick.com/forum/34534/method-and-function

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
