Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Python Basics Functions and Looping Functions

Functions, methods, parameters, arguments, keywords ...

All of these terms are causing me a lot of confusion, especially since some of them seem to be used interchangeably. Can someone please parse these out a little, or point me to a glossary that clearly defines them? Thanks!

1 Answer

Andy McDonald
Andy McDonald
5,016 Points

Yes! So an easiest way to separate the difference between a function and a method is the preceding '.'. For example print() is a function and .sort() is a method. This is getting a little further into the weeds, but a method is a function of an object. Similarly to the bark of a dog. Barking is a function but because its exclusive to a dog, it is then a function. Parameters and arguments are also similar but you can think of a parameter as the invitation to pass an argument. For example print() has one parameter, when I pass the argument 'hello world' to print(this would look like: print('hello world'), it prints: hello world Keywords is a little vague. There are 'keyword value pairs' but I don't think you've made it to a point where you are learning that yet. Comment if you have any questions. Select best answer to show some love.

The bark of a dog analogy sums it up quite nicely for me, thanks!