Python Basics: Your First Python Programs
Beginner · 30 minutes · 100 points
Get hands-on with Python fundamentals by writing and running real Python scripts inside a container. You will practice variables, data types, control flow, functions, and file I/O — the essential building blocks every Python developer needs.
What you’ll learn
- Write and execute Python scripts using variables, data types, and print statements
- Use conditionals and loops to control program flow
- Define and call reusable functions
- Read and write data to files using Python's built-in file I/O
How this lab works
- Start the lab: One click starts a container on your computer with a real terminal: nothing to install by hand, nothing to clean up.
- Work through 4 tasks: Each task says what to build or fix. You do it yourself, in a real terminal, with hints when you get stuck.
- Check your work: Check my work runs each task’s checks in your container and says what passed and what to fix.
- Finish and keep going: 100 points, your progress saved, and the next lab to try.
What it runs on
- Runs: A container on your computer, with a real terminal
- Image: python:3.12-slim
What you need
- A free LearnXops account
- The LearnXops desktop app for macOS, Windows or Linux
- Docker Desktop installed and running
Topics: python, variables, loops, functions, file-io, scripting
Create a free account to start this lab.