livepython.net
CHAPTER 01Introduction to Python
1.4  LIVEPYTHON

How to Learn Python on LivePython

Slides, Checks and Clues

Every topic on LivePython is one page, split into small slides. Each slide teaches one idea, so you never face a wall of text.

Moving around

  • Press Next to go to the next slide, and Back to go back. The ← and → arrow keys work too.
  • The dots at the top show where you are. Numbered dots are lessons. Small ? dots are questions.
  • Click any dot to jump straight to that slide.

Your turn

After most lessons, a Your turn slide asks you a quick question on the whiteboard. There are a few kinds: predict what code prints, fill a gap, find a bug, put lines in order, or fix some code.

  • Pick a wrong answer, and the tutor gives you a clue. Read it, think, and try again.
  • Pick the right answer, and the tutor tells you why it's right. The dot at the top gets a tick.

There are no points and no timer. Questions are there to help you check your understanding, not to test you.

Stuck? You can press Next to skip a question and come back to it later from its dot. Your progress is kept in this browser.

Learn a little, try it, then move on.

your turnPick the right idea

You pick a wrong answer in a Your turn question. What happens?

Think about it, then pick one.

Edit and Run Code in Every Lesson

Every code example on LivePython is a live editor. That means you can change the code and see the result right away. Try it here:

PYTHONedit me
print("Edit me!")
OUTPUT
Edit me!

Here's how a live editor works:

  • The edit me label means you can click into the code and type.
  • After you stop typing, the code runs by itself, and the output box shows the result.
  • Reset brings back the original example.
  • If your code has a mistake, the output turns red and shows the error, with a plain-English hint to help you fix it.

Some editors also have an Input box, for programs that ask the user to type something. You'll use those in the Input chapter.

Make it a habit

Reading code is good. Changing it is much better. Whenever you see an example, ask yourself "what if?" What if I change this word? What if I add a line? What if I remove the quotes? Then try it and see. You can't break anything, and every experiment teaches you something.

Don't just read code. Change it and see what happens.

your turnFix the code

Fix the code

It should print: I will learn Python

print("I will learn Python"
This line is missing something, so Python can't run it. Fix it, then press Run.

Practice Questions and the Online Compiler

Lessons teach you an idea. Practice questions help you remember it. At the end of most topics, you'll find a few questions that ask you to write a small program on your own.

Each practice question page has:

  • the task, with an example of the output it expects,
  • a code editor and a Run button, to try your code as often as you like,
  • a Submit button, which checks your code against every test,
  • hints, for when you're stuck,
  • and a Learn this first link back to the lesson it needs.

A question is solved when your code passes every test. Solved questions get a tick, so you can see your progress at a glance.

The online Python compiler

Want to try your own ideas? The Python compiler is a full code editor in your browser. You can write programs of any length, create files and give input. Sign in, and you can share a link to your code too. It's free and needs no installing.

Lessons teach you. Practice makes it stick.

your turnPick the right idea

When is a practice question solved?

Think about it, then pick one.

Your Python Roadmap

This course has 20 chapters in 5 stages. Each stage builds on the one before, so it's best to go in order.

StageChaptersAfter it, you can
1. StartIntroduction, The print() function, Programmer mindsetwrite your first programs and think in steps
2. Store dataVariables, Data types, Comments, Inputstore values, change them and ask the user for them
3. Decide and repeatIf statements, Lists, For loops, While loopsmake choices and repeat work automatically
4. OrganiseStrings, Dictionaries, Tuples and sets, Functions, Styling your codework with text and collections, and reuse your code
5. Real programsExceptions, Modules, File handling, Object-oriented programmingbuild complete programs that handle errors and save files

How to go through it

  • One topic at a time. A topic takes about 10 to 20 minutes.
  • Do the Your turn questions. They show you what you've really understood.
  • Solve the practice questions before you move to the next chapter.
  • Come back to old topics whenever something feels shaky. That's not going backwards, it's how learning works.

You've already finished most of stage 1's first chapter. Next up: the print() function, where you'll learn to show anything you like on the screen.

One topic at a time. Small steps add up to big skills.

your turnOrder the lines

Put the stages in order

  1. Make decisions with if
  2. Store data in variables
  3. Reuse code with functions
  4. Write your first programs
  5. Build programs with classes
These lines are mixed up. Put them back in order, then press Check.