Introduction to Python
Welcome to Trifling! This interactive tutorial will teach you Python programming right in your browser. No installation required.
Your First Program
Let's start with the classic "Hello, World!" program:
▶ Interactive Python
Click the Run button to execute the code. You can edit the code and run it again!
Variables and Data Types
Python makes it easy to work with different types of data:
▶ Interactive Python
Loops
Loops let you repeat actions:
▶ Interactive Python
Lists
Lists store multiple values:
▶ Interactive Python
Functions
Functions help you organize code:
▶ Interactive Python
Conditionals
Make decisions in your code:
▶ Interactive Python
Interactive Input
Try using input() to get user input:
▶ Interactive Python
Try It Yourself
Create a simple program that asks for a number and prints its square:
▶ Interactive Python
Next Steps
Now that you know the basics, try these tutorials:
- Turtle Graphics - Create drawings and animations
- Canvas API - Draw shapes and images directly
- Trifle Imports - Share code between projects
Remember: You can turn any example into a trifle by clicking Make Trifle!