Programming Open textbook
Python for absolute beginners: variables, input, while loops and if statements
Built automatically from three early chapters of the open textbook "Non-Programmer's Tutorial for Python 3" on Wikibooks: input and variables, while loops and decisions. Not reviewed by a person.
3 lessons, 14 steps
Python from the very first line
This is Python for beginners in the literal sense: a course for people who have never programmed and want to learn Python at a calm pace. It follows the opening chapters of a tutorial written for non-programmers and turns them into questions you answer yourself.
Lesson 1 deals with input, variables and data types: what an assignment like first_name = "Bill" actually does, when to wrap input() in int() or float(), and how plus and multiplication behave with strings, so that "Ha, " * 5 prints five laughs in a row. Lesson 2 introduces while loops: the colon at the end of the while line, indentation as the way Python marks a block, the == operator, and how to stop a program stuck in an infinite loop. Lesson 3 covers decisions with if, elif and else, comparison operators such as !=, and working out which branch of a small guessing game runs.
Each lesson opens with a few sentences of explanation and then four to six steps. You choose an option or type the exact result, for example the string an expression produces. A wrong answer does not end the step: the AI tutor first asks a question that points at the slip, then gives a hint, then shows part of the answer. Show solution stays available the whole time, and short quizzes at the start and end of each lesson let you compare.
This course was assembled automatically from the first chapters of the Wikibooks textbook "Non-Programmer's Tutorial for Python 3" and has not been checked by a person. Volunteers write the book and it may contain errors; the three lessons here cover only the beginning.
What you'll learn
- Store data in variables and perform string concatenation and repetition
- Construct while loops to repeat statements until specific conditions are met
- Direct program flow using if, elif, and else statements
Lessons
Input, Variables, and Data Types
Repetition with While Loops
Decision Making with If Statements
How the tutor handles a slip

Tutor: What string does the expression "i" * 5 produce?
You: i * 5

Tutor: Remember that multiplying a string by an integer repeats the characters. How many times will "i" repeat?
You: Five times, so the result is iiiii.

Tutor: Yes, iiiii. With a string and a whole number, multiplication means repetition: five copies of "i" joined together.
Is this Python course for you?
- You have never written code and want a gentle start with Python.
- You watched a Python video course and want to test whether the basics stuck.
- You want loops and if statements to make sense before you move on to bigger programs.
- You learn better when you have to commit to an answer.
Python course FAQ
Do I need to install Python?
Not for the course. The questions are about short lines of code and what they produce, and you answer them in the app. If you want to try the same lines yourself, you will need Python on a computer.
Is this a full Python course?
No. It covers the first chapters of the tutorial: variables and input, while loops, and if statements. Functions, lists and files are not part of these three lessons.
Is the course free?
One lesson in Ai Teacher is free. After that, a subscription opens all lessons. You can pay monthly or yearly in Google Play, and usage limits apply.
Source and license
This course is adapted from Non-Programmer's Tutorial for Python 3, an open textbook on Wikibooks written by Wikibooks contributors (see the page history of each chapter below). The textbook is licensed under CC BY-SA 4.0.
This course was built automatically from the open textbook "Non-Programmer's Tutorial for Python 3" on Wikibooks. No person has reviewed it. Changes: Adapted by AI into lessons and questions; shortened. Written by volunteers; it may contain errors.
Chapters used
Related courses
- Programming
Python from Zero
For adults who have never programmed: read short Python programs, work out what they print and choose fixes for common mistakes with variables, if / elif / else and loops. You type or pick each answer; the app does not run code.
3 lessons, 18 steps - Programming Open textbook
JavaScript
Built automatically from early chapters of the open textbook "JavaScript" on Wikibooks: JavaScript in HTML, syntax, lexical structure, dates and arrays. Not reviewed by a person.
From Wikibooks, 3 lessons - Computers Open textbook
Introduction to Computers
Built automatically from early chapters of the open textbook "Introduction to Computers" on Wikiversity: computer types, hardware and software, the processor and future peripherals. Not reviewed by a person.
From Wikiversity, 3 lessons - Programming Open textbook
Structured Query Language
Built automatically from early chapters of the open textbook "Structured Query Language" on Wikibooks: language elements, creating tables, handling data and an example database. Not reviewed by a person.
From Wikibooks, 3 lessons