ORVIAN / PRACTICAL LESSON

Python: your first program

Learn variables, input, conditions, and a simple repeatable exercise.

01 / STEP

Check Python

Open a terminal and check your installed version.

python3 --version
02 / STEP

Write a small program

Save this program as hello.py. The input becomes a string stored in a variable.

name = input("What is your name? ").strip()
print(f"Hello, {name or 'builder'}!")
03 / STEP

Run and change it

Run the file. Then change the greeting and run it again.

python3 hello.py
04 / STEP

Try it independently

Ask which subject someone wants to study and print a personalized study message.

← All lessons