Welcome to your first Python tutorial! Let's start with the most fundamental skill in programming: displaying output.
print() FunctionThe print() function is your primary way to show information to users. It's simple but powerful.
print("Hello, World!")This displays: Hello, World!
You can print multiple things at once, separated by commas:
print("Python", "is", "fun!")This displays: Python is fun! (Python adds spaces between items automatically)
print(42) # whole number
print(3.14) # decimal number
print(10 + 5) # math calculationNotice the # symbol? Everything after it on a line is a comment — Python ignores it. Use comments to explain your code.
# this is a comment
print("This runs") # this is also a commentClick the example code button to load a working example, then try these challenges:
Once you're comfortable with print(), move on to Variables and Data Types to learn how to store and work with information!