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!
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
Cristian Yanez491 Points
Classes, object, methods?
What exactly is a class, an object, a method and def? Also what is arguments or parameters. I know the definition of these, but can someone show me them in code?
def my_function_name(): <--- Is this considered an object? Print("this is the functions body") <------- is this considered a method?
What is print? An object method or class? Once again, I know the definition what can someone show me them in code so I can see them in action?
Also what do you mean when you say "not all values are variables"?
Alexander Davison65,469 Points
Be patient... I know the beginning of this course can get really confusing, but I know you are smart and eventually you'll understand
- A type is like the kind of value like for example the text "Hello world" is type of String, and 3 is type Int (short for integer)
- In Python, you can even (basically) create your own types, and these are called
- In Python,
defis short for "define". You use this key word to tell Python "Over here, I'm going to create my very own function".
- In Python,
arguments are the values you pass in to a function. The meaning are slightly different...
- Arguments are the actual values passed in. Parameters are the name of the argument you use in the function definition.
Again, don't worry too much about this, you will see these all come together in close future
Got more questions I didn't catch? Feel free to ask below. :)
I hope this helps. ~Alex