By the end of this lesson, you will be able to:
Definition: EduBlocks is a free, browser-based application that uses a block-based approach to teach Python programming, making coding accessible without requiring syntax knowledge.
:information_source: Remember! EduBlocks is your bridge from visual blocks to real Python code! Every block you use represents actual Python commands that professional programmers use every day.
EduBlocks is available online at edublocks.org and requires a Google account for saving projects and tracking progress.
:bulb: Troubleshooting
If you can't sign in, try:
- Using a different browser (Chrome or Firefox work best)
- Clearing your browser's cookies
- Asking your teacher to check if your Google account is allowed
Once signed in, you'll see the app home page with essential navigation elements.
The sidebar contains two crucial icons:
:information_source: Remember! Always check that you're signed in before starting work - look for your name in the top right corner!
Follow these essential steps to create a new project:
Step One: Select Python 3 Mode
Step 2: Name Your Project
Step 3: Start Coding
:bulb: Save Often!
Get in the habit of saving your project every few minutes. Press Ctrl+S (or Cmd+S on Mac) to quickly save your work!
Command blocks are the foundation of program structure and can be stacked together to create sequences.
Python Connection: Command blocks represent Python statements - lines of code that tell the computer what to do!
Value blocks are rounded and fit inside command blocks or other value blocks to provide data.
Block Type | Characteristics | Usage | Python Equivalent |
---|---|---|---|
Command Blocks | Rectangular, stackable | Program instructions and structure | Statements like print(), if, for |
Value Blocks | Rounded, nestable | Data and information storage | Values like "hello", 42, True |
:information_source: Remember! Think of command blocks as actions (verbs) and value blocks as things (nouns). You need both to make a complete sentence in your program!
Purpose: Display text and information on the screen for program output and debugging.
The print() function serves as your primary tool for showing program results and understanding program flow. In programming, text is called a string - a sequence of characters forming words and sentences.
To use the print function:
Key characteristics of strings:
Python Connection: In real Python, you write print("Hello World!")
- the blocks create this exact code for you!
The backslash () symbol acts as an "escape" character for special formatting and character inclusion.
Newline characters create line breaks in output, similar to pressing Enter in text documents.
:bulb: Try This!
Create a print block that displays:
Hello World
Use \n between Hello and World!
Escape sequences allow you to display actual quotation marks within string values.
Use double backslashes (\\) to display the backslash symbol itself.
Python Connection: These escape characters work the same way in real Python code!
The input() function enables user interaction by accepting keyboard input during program execution.
To use the input function:
:bulb: Troubleshooting Input
If your program seems frozen:
- Look for the input prompt in the output area
- Type your answer and press Enter
- The program is waiting for you!
Python Connection: In Python, you'd write input("What's your name? ")
- the blocks create this for you!
Purpose: Provide human-readable explanations and labels for code sections without affecting program execution.
Comments serve multiple essential purposes:
:information_source: Remember! Comments are like sticky notes for your code - they help you and others understand what your program does!
EduBlocks provides intuitive comment functionality for every block in your program.
Adding a Comment:
Python Connection: In Python, comments start with # - like # This prints a greeting
Comments are visually connected to their associated blocks and can be fully customized.
Comment Management:
Effective commenting creates maintainable and understandable code.
Recommended Uses:
:bulb: Comment Challenge!
Try adding these comments to your first program:
- "My first EduBlocks program"
- "This asks for the user's name"
- "This says hello to the user"
Professional Tip: Develop the habit of commenting as you code. Comments become invaluable when returning to projects after time away, helping you quickly understand your previous work and continue development efficiently.
Ready for more? Try these extra challenges:
Create a program that prints a 3-line message using \n characters. Example:
Welcome to EduBlocks!
Today we're learning Python.
Let's code together!
Use multiple input() and print() blocks to create a short interactive story:
Create a program that prints your favorite quote WITH quotation marks showing. Remember to use " to display the quotes!
Add detailed comments to every block in your program explaining:
Congratulations on completing your first EduBlocks lesson! You've learned:
You're now ready to create your own Python programs using blocks! In the next lesson, we'll explore variables and how to store information in your programs.
:information_source: Remember! Every professional programmer started exactly where you are now. Keep practicing, stay curious, and have fun with your code!