PyPython · Lesson 1 of 14
Hello, World!
Every coding journey starts with Hello World. It's tradition, hazing, and a sanity check all rolled into one.
In Python, printing to the terminal takes exactly one line. No imports, no class definitions, no semicolons. The print() function outputs text (or any value) to standard output and appends a newline automatically.
Save that as hello.py and run it with python3 hello.py. That's it — you're a programmer. print() is more flexible than it looks: it accepts multiple arguments and lets you customize the separator and line ending.
◆ Note
Python 3 print() is a function — print("hello"). Python 2 had print as a statement — print "hello". Python 2 reached end-of-life in 2020. Do not learn Python 2.
Python 3 print() is a function — print("hello"). Python 2 had print as a statement — print "hello". Python 2 reached end-of-life in 2020. Do not learn Python 2.