Your First Python Program
It's high time we tested our understanding and our setup. Let’s test our setup by writing a "Hello, World!" program in Python on our own. Follow the steps below:
Try this in Python Shell(REPL) or IDLE:
>>> print("Hello, World!")
Expected Output:
Hello, World!
Try this in a Python Script:
-
Open your editor and type:
print("Hello, World! Welcome to Python!")
-
Save it as
hello.py
. -
Run it in the terminal:
python hello.py
Expected Output:
Hello, World! Welcome to Python!
Congratulations! You have set up your Python environment and written your first program!