Python Basics
Python is the language that most AI work is written in. In this lesson you write your first lines of real Python, right here on this page. You will store values, work with numbers and text, make decisions, and read error messages. You do not need any programming experience.
New words
- program
- A list of instructions that tells a computer what to do, step by step.
- variable
- A named box in the computer that holds a value, like a labelled tiffin box.
- string
- Text inside quotes, such as "hello", which is a chain of letters.
- type
- The kind of a value, such as a whole number, a decimal number or text.
- function
- A named action that does one job, such as print().
- indentation
- Empty space at the start of a line that shows which lines belong together.
- error message
- Python's note that says which line failed and what kind of problem it is.
What you will learn
- Why do AI engineers use Python?
- What are print() and variables?
- Types: what kind of value is in the box?
- Working with text
- Comparing and deciding
- Try it: the variable boxes
- Common mistakes and how to read an error
- Explain it to a friend
- Key takeaways
10 quiz questions at the end.
The full lesson, with interactive demos and the quiz, opens after you sign in with Google. It is free.