Write Python. Understand every error.

Starting Python in your browser…

Python basics · topic 1 of 25

About Python

Python is a programming language: a precise way of giving instructions to a computer. It was created by Guido van Rossum and first released in 1991. It is popular because its code reads almost like English, and it is used for data science, artificial intelligence, websites, automation and teaching.

A Python program is a list of instructions called statements. Python runs them one at a time, from the top line to the bottom line.

print("Good morning")
print("Time for Python")

Lines that start with # are comments. Python skips them completely. Comments are notes for people who read your code.

Python can also work as a calculator. It follows the usual order of operations, so multiplication happens before addition unless you use brackets.

  • Python runs your code from top to bottom.
  • print() shows a value on the screen.
  • Text starting with # is a comment and is ignored.
  • Python is case-sensitive: print works, Print does not.

Key takeaways

  • Python runs your program one line at a time, from the top line to the bottom line.
  • print() shows a value on the screen, and text after # is a comment that Python ignores.
  • Python is case-sensitive: print works but Print does not.
  • An error message names the line and the kind of problem, so read it before you change anything.

Common mistakes

Share this page:

Ctrl + Enter to run
Line 1, column 1Tab indents 4 spaces. Press Esc then Tab to leave the editor.