14
Lesson 14 of 20 ยท From Blocks to Text
From Blocks to Text โ Part 3
Same ideas in text code. This is part 3 of 20.
What you'll learn
You will learn to read text-based code and understand that syntax rules (spelling, colons, indentation) matter.
Steps
- 1This is text-based code (not block-based). You type it out with words and symbols. Spelling and spacing matter!
- 2Notice the colon : after range(3) and the indentation (spaces) before print. These are Python's syntax rules.
- 3The loop runs 3 times. The output would be: Line 1, Line 2, Line 3, Done. Can you trace through it?
- 4Reading code is a skill. Practice by going line by line and predicting what the output would be BEFORE checking!
Key Terms
- Text code
- Code written as words and symbols. Python is text code. Spelling and indentation matter.
- Syntax
- The rules for how to write code correctly (colons, indentation, etc.).
- Indent
- Adding spaces at the start of a line. Code inside a loop or if must be indented.
Python 3
Output
Loading Python... This may take a few seconds.
Your code runs only in your browser. No code is sent to any server. Stay safe and have fun learning!
๐จ๏ธView in Shop
Checkout complete lesson on From Blocks to Text for 6th Grade
Get the full From Blocks to Text track as a printable PDF โ all lessons, worksheets, and answer keys.
