Python: Difference Between a Function and a Method (Non-technical definition)

The only difference is the location within your code: a method is a function located inside a class.

As a new programmer, I like to think about these definitions in terms of how techniques are used most of the time — with the assumption that there may be some circumstances where there is a difference, but in practical terms it’s not important.

Take a look here if you would like a technical definition about the difference between a function and method more generally in object oriented programming: https://stackoverflow.com/questions/155609/whats-the-difference-between-a-method-and-a-function#155655

--

--

--

I am a librarian and new computer programmer creating an app with Python and Kivy to document the plants in my garden.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

3 new ScandiPWA extensions available for free — RMA, Gift Cards, Amasty Special Promotions

HDDG 34: Crushing Bugs and Capturing Packets

BitPost : Heard about collections in Python?

How to get my Ubuntu 18.0.4 GUI back from TTY?

How to use Android Injector for Activity and Fragment objects through New Dagger 2 (with Kotlin)

Movr Powers Seamless Bridging For Zerion

Setup PuTTY with server’s PPK on Debian or Windows

An efficient approach for deploying multiple powerups in Unity

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Rachela

Rachela

I am a librarian and new computer programmer creating an app with Python and Kivy to document the plants in my garden.

More from Medium

Learn About Loop in Python

Recursion and Python Strings

Python Lists and Dictionaries

Functions and Exception Handling in Python