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 (2015) Python for Beginners Call a function

Function definition

The code challenge referred to print() as a function. But I thought functions had to look like: def codeChallenge (): print("blah") and then be called later on????

So how is print() a function???

2 Answers

Hi Catherine,

what you mean is the syntax with which functions are defined in Python. You define a function with

def function():

, but you call it with function(). In this sense, print() is no different, as you do not define it again but call it.

ok so print is a function that already exists in Python therefore it doesn't need to be defined. All the user has to do is call it in order to use it. Is explanation correct???

Yes exactly

Thank you so much