✦ Python Foundations Your first program

Start Here · Python Foundations

Meet Python — Start Your
Programming Journey

Meet Python, see where it is used, and run your first small program.

Learning goalUnderstand what Python is, where people use it, and how a small instruction becomes a result.
01 Meet Python02 Run your code03 Make it yours

Learning as a guest

Learning as a guest? Save your progress!

Create a free account to learn with Sloby AI, check your understanding, and track your progress.

The entire platform is free throughout 2026. Foundations stays free forever.

Did you know?

A Short Story of Python

Guido van Rossum created Python. Work began in the late 1980s, and the first public release appeared in 1991. Python was named after the comedy show Monty Python’s Flying Circus, not originally after a snake.

Why Python?

Easy to start. Ready for real work.

Python is easy to start with, but it is not just a beginner language.

Readable

Python code often looks like simple, understandable instructions. That makes it easier to focus on the problem you want to solve.

Beginner-friendly

You can make a small program quickly without a lot of extra setup, then build confidence through experiments.

Powerful

Python is used for serious professional projects as well as learning. Easy to start does not mean limited.

Huge ecosystem

A large collection of libraries, frameworks, and tools gives Python developers helpful building blocks.

Where is Python used?

Six directions you can explore.

Web Development

Python can run the server side of a web application: the part that receives requests, works with data, and sends pages back. Later in Python AI Tutor, we will use Django to build real web applications with Python.

You could build a project hub or a small website.

Artificial Intelligence

Python is very often used for AI and machine-learning tools and applications. You do not need to understand the deep theory to begin exploring what these tools can do.

You could explore an AI-assisted learning tool.

Data & Analysis

Python can collect, calculate, organize, and visualize data. You do not need to understand every part of this code yet. We will learn lists and functions later.

grades = [5, 4, 5, 3, 5]
average = sum(grades) / len(grades)

print(average)
You could calculate an average from grades.

Automation

Python can rename many files, process spreadsheets, organize data, and handle repetitive computer tasks. If you repeatedly do the same computer task, Python may be able to automate part of it.

You could organize a folder full of reports.

Games & Creative Projects

Python is a welcoming place for quizzes, simple games, text adventures, simulations, and creative experiments.

You could create a quiz or a text adventure.

Science & Education

People use Python in mathematics, physics, biology, research, and when processing experimental results.

You could explore a small science calculation.

Python is a language for giving a computer instructions

A programming language is a way to give a computer instructions. A program is a set of instructions that the computer follows. Python is one programming language that helps people turn ideas into small programs, useful tools, and bigger projects.

print("Hello!")
print("I'm learning Python.")

print() tells Python to display something on the screen. "Hello!" is text that Python should display; the quotation marks show Python that it is text. Each print() instruction produces its own output line.

You do not need to learn every detail about print() yet. For now, notice one simple pattern: you write an instruction, run the program, and Python follows the instruction.

↳

A good first habit: Read the code, make one small change, run it, and notice what changed. Trying small experiments is a real programming skill.

Your instruction → Python runs it → Result
print("Hello, Ana!")

1. You write an instruction. 2. Python reads and runs it. 3. A result appears on the screen. The computer does not guess what you mean—it follows the instructions you give it.

A small preview: remembering a name
name = "Ana"
print("Hello", name)

Python can store information under a name and use it later. Here name is called a variable. Variables are the next Foundations concept, so you do not need to understand this syntax yet—just notice that the stored name appears in the greeting.

Programming is problem solving, not memorizing
Understand the problem → Break it into smaller steps → Write something → Run it → Read the result or error → Change it → Try again

For example: the goal is to make the computer greet a user. What do we need? A name and a way to display a message. Programmers start with a small idea, test it, and improve it instead of memorizing every command.

You do not need to understand everything yet
See code → ask “What does it do?” → learn the details step by step

During this course, you may see Python code containing things you have not learned yet. That is okay. First try to understand what the program does. Step by step, you will learn what each part means.

A calm way to begin programming

  1. Start with one clear goalSay what you want the computer to do in ordinary words before you write code.
  2. Make the first small attemptWrite one or two instructions, then run them. A small working step is more useful than a perfect plan that never gets tested.
  3. Use results and errors as informationAn error message tells you that Python found something it could not do. It helps you discover what needs to change, and experienced programmers see errors too.

Sloby’s first tip

  • Errors are part of programmingAn error is not a sign that you are bad at programming. Read what happened, change one small thing, and try again. That is how programmers learn what a program needs.

Python Playground

Loading Python runtime…

Make this tiny program yours: 1. Change the text inside the quotation marks. 2. Enter your name or nickname. 3. Write one reason you want to learn Python. 4. Run the program. 5. Read the output. 6. Change one sentence and run it again. You just changed a program and made the computer follow your instruction.

meet_python.pyPython
OutputWaiting for Python
The browser runtime is loading. You can still edit the example code.

Pyodide runs Python in a browser Web Worker. It is stopped and restarted if code keeps running. Browser execution is not a complete security boundary; do not enter secrets or rely on it for untrusted code isolation.

What will this program display?

Read from top to bottom. Each print() shows its text on a new line.

print("Python")
print("AI Tutor")
Choose the output
Sloby, the Python AI Tutor mascot

Your learning mentor

Sign in to ask Sloby

Create a free account or sign in to get AI guidance while you learn.

Sign in to check your understanding

Create a free account or sign in to receive AI feedback and save your learning progress.

Python AI Tutor · Learn by understanding, not just by running code.