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 The Python Shell

Command as a function? What?

Why are you named functions exit() and quit() as commands? Are they even functions? I'm confused. Can someone, please disassembled me in strict rules when is what a command, when is a statement and when is a function. How many else terms are in python which should I know on purpose to not come in these situations?

1 Answer

They are system functions within python. when you call the function, is runs to exit out of the python repl. sys.exit is used to kill a script.

https://docs.python.org/2/library/sys.html?highlight=sys.exit#sys.exit

Moderator Edit: Moved response from Comment section to Answers.

Jason Anders
Jason Anders
Treehouse Moderator 145,860 Points

Hi AJ Longstreet

Thanks for participating in the Community. :)

If you could, however, put your responses as an Answer and not a Comment, others in the community will know that an answer has been provided.

I have changed the other three Comments to Answers.

Thanks Again and Keep Coding and helping! :) :dizzy:

Jason - Treehouse Moderator

OOPS! :-P