Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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!

2 Answers

Andy McDonald
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Andy McDonald
Python Development Techdegree Graduate 13,801 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!

Kenny Storms
Kenny Storms
2,693 Points

I just want to make sure I have it right. The following is from above--

"Barking is a function but because its exclusive to a dog, it is then a function."

Is this supposed to say. Barking is a function but because it's exclusive to a dog, it is then a METHOD." ?