25 lines
725 B
Python
25 lines
725 B
Python
|
|
# Lesson 01: Hello World
|
||
|
|
#
|
||
|
|
# This is your very first Python program. Every programming journey starts here.
|
||
|
|
# Lines that start with '#' are comments — Python ignores them. Use them to
|
||
|
|
# leave notes for yourself or anyone reading your code.
|
||
|
|
#
|
||
|
|
# To run this file:
|
||
|
|
# python 01_hello_world.py
|
||
|
|
|
||
|
|
# The print() function outputs text to the screen.
|
||
|
|
print("Hello, World!")
|
||
|
|
|
||
|
|
# You can print any text you like — just put it inside the quotes.
|
||
|
|
print("Welcome to the coding workshop!")
|
||
|
|
|
||
|
|
# You can also print numbers without quotes.
|
||
|
|
print(42)
|
||
|
|
print(3.14)
|
||
|
|
|
||
|
|
# print() can combine text and numbers using commas.
|
||
|
|
print("The answer is", 42)
|
||
|
|
|
||
|
|
# --- Try it yourself ---
|
||
|
|
# Change "Hello, World!" to your own greeting and run the file again.
|