Python Programming Language

Python Hello World Program

By

First published on October 10, 2019. Last updated on February 6, 2021.


Hello World Program

If you have Python, you can try a Hello World program. Examine a simple Python program called HelloWorld.py

print 'Hello World!'

This is a simple program. There are no special structures, so no indentation spaces are required. The file name should end in .py

Create your program in a text editor and name it: HelloWorld.py

To run the program. type into your terminal:

python HelloWorld.py

The output should be:

Hello World

Congratulations! If you can create this program and run it, you are now a Python programmer!

Leveling Up

  • Modify the program by writing additional print statements with your own messages. Can you make it work?
  • Ask yourself, how is a computer program different from a web page? (Keep this question in mind as you learn more.)

COURSE


Content is copyright the author. Layout is copyright Mark Ciotola. See Corsbook.com for further notices.