Skip to main content

Python for beginners

Write Your First Python Program (Step by Step)

Your first program is a confidence milestone. Write print, run the file, read the output, then make one small change so you know the edit-run loop.

Pythonbeginner4 min readPython for beginners

Learning overview

Estimated time
4 minutes
Difficulty
Beginner
Prerequisites
No prior experience required
Learning outcome
Explain python using a clear mental model · Apply python in practical Python work
Last updated
July 20, 2026

Goal: make the computer say something

A program is a list of instructions. Your first goal is simple: show text on the screen. That proves your tools work and that you can give instructions Python understands.

Hello, World in Python

The print function displays values. Text goes inside quotation marks. When you run the program, Python shows the text in the output area or terminal.

hello.py
print("Hello, World!")

Output

Hello, World!

Learn the edit-run loop

Change the message, save the file, run again. This loop is how programmers learn. Small experiments teach faster than long reading sessions.

hello.py
print("Hello from my first program")
print(2 + 2)

Output

Hello from my first program
4

What good beginner practice looks like

Keep programs tiny. Run often. Read errors slowly. Celebrate output appearing — that is real progress, not a toy.

  • One idea per program at first
  • Save before running
  • Compare expected output with actual output
  • Write a one-line note about what you learned

Frequently asked questions

What does print do in Python?

print shows text or calculated values in the program output so you can see results.

Do I need quotes around numbers?

No. Numbers used for math usually have no quotes. Quotes mark text. print(2 + 2) calculates; print("2 + 2") shows characters.

What file extension should I use?

Use .py for Python source files, such as hello.py.

What next after Hello World?

Learn variables so your program can store values, then try user input and simple decisions.

Topic graph

A taxonomy-generated path through this subject.

  1. Python
  2. Python for beginners
  3. python
  4. beginners
  5. first-program
  6. print
  7. What Is Python in Programming?
  8. Learn Python: From Fundamentals to Real Applications
  9. Python Tutorial: Build a Command-Line Expense Tracker

Recommended automatically from shared technologies, topics, intent, and difficulty.

Hand-picked companion pages that deepen this topic.

blogWhat Is Python? A Complete Beginner Guide (2026)blogWhat Is Python Used For? Real Examples for Beginners (2026)blogIs Python Easy to Learn? Honest Beginner AnswerblogHow to Install Python: Beginner Setup GuideblogPython print() Explained for Absolute BeginnersblogPython Comments for Beginners: Why and HowblogPython Syntax for Beginners: Rules That MatterblogPython Variables for Beginners: Store Values ClearlyblogPython Data Types for Beginners (With Examples)blogPython Strings for Beginners: Text in CodeblogPython Numbers and Math for BeginnersblogPython User Input for Beginners: input() GuideblogPython Operators for Beginners: Math and ComparisonblogPython if else for Beginners: Make DecisionsblogPython for Loops for Beginners (Clear Examples)blogPython while Loops for Beginners: Repeat Until DoneblogPython Lists for Beginners: Store Many ValuesblogPython Tuples for Beginners: Fixed SequencesblogPython Dictionaries for Beginners: Keys and ValuesblogPython Functions for Beginners: Reuse Your CodeblogPython import and Modules for BeginnersblogPython Errors and Debugging for BeginnersblogPython vs Java for Beginners: Which to Learn First?blogPython vs JavaScript for BeginnersblogWhy Learn Python in 2026? Beginner Reasons That MatterblogPython Project Ideas for Beginners (Start Tiny)blogPython Booleans for Beginners: True and FalseblogPython Type Conversion for BeginnersblogHow Does Python Work? Beginner Interpreter GuideblogBest Way to Learn Python for Beginners (2026)blogPython Indentation Explained for BeginnersblogPython f-Strings for Beginners: Cleaner TextblogPython range() for Beginners: Count with LoopsblogPython len() for Beginners: Count Items and Characters

Your next steps

Continue learning

  1. 1glossaryWhat Is Python in Programming?
  2. 2guidesLearn Python: From Fundamentals to Real Applications
  3. 3guidesPython Tutorial: Build a Command-Line Expense Tracker
  4. 4guidesLearn Java: From First Program to Real Applications