1. Home
  2. Computing & Technology
  3. Python

"Merry Christmas!": A Quick Tour of Python

From , former About.com Guide

7 of 7

Tying It Up With a Bow

Alas, we are not done yet. If the program were executed now, it would end with no output whatsoever. This is because the function main() is never called. Here is how to call main() when the program is executed:

if __name__ == '__main__':
main()

Save the program as 'MerryChristmas.py' (without the quotes), or use a name of your preference. Now, you can start the program. Assuming the Python interpreter is in your execution path, you can type

"python MerryChristmas.py julie muslim german !"
and you will be rewarded with the familiar output:
Schön Ramadan, Julie!

Having read through this rather brisk tour of Python, if you find you still do not understand how certain parts of the language work, I encourage you to read my tutorial for "Beginning Python" instead.

Explore Python
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Python

©2009 About.com, a part of The New York Times Company.

All rights reserved.