0% found this document useful (0 votes)
49 views24 pages

Python Coding with Edu-Blocks Guide

The document provides an overview of coding concepts using Python and Edu-Blocks, focusing on sequence, selection, and iteration. It explains how to use Edu-Blocks for block-based coding, including the interface and functionality for generating Python code. Additionally, it introduces the Turtle graphics library for visual programming and includes examples of code for drawing shapes like octagons and decagons.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views24 pages

Python Coding with Edu-Blocks Guide

The document provides an overview of coding concepts using Python and Edu-Blocks, focusing on sequence, selection, and iteration. It explains how to use Edu-Blocks for block-based coding, including the interface and functionality for generating Python code. Additionally, it introduces the Turtle graphics library for visual programming and includes examples of code for drawing shapes like octagons and decagons.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Python Using Edu-blocks

Learning Outcomes
• - Understand block-based coding to create
programs
• - Learn coding concepts: Sequence, Selection,
Iteration
• - Gain familiarity with Python and EduBlocks
What is Coding?
Coding is giving instructions to a computer to
make it perform specific tasks, step by step.
• Coding solves problems (e.g., Alexa)
• Large projects are broken into smaller tasks
• Use logic to solve problems step-by-step
Key Coding Concepts
1. Sequence
What is it?
Sequence means following steps in order, one
after another.
Example:
Brushing your teeth:
• Pick up the toothbrush.
• Put toothpaste on it.
• Brush your teeth.
• Rinse your mouth.
2. Selection
What is it?
Selection means making a choice based on a
condition. It usually uses IF statements.
Example:
Choosing an umbrella:
• If it is raining, take an umbrella.
• If it is sunny, wear sunglasses.
3. Iteration
What is it?
Iteration means repeating steps. It usually uses
loops.
Example:
Clapping hands 5 times:
• Clap 1
• Clap 2
• Clap 3
• Clap 4
• Clap 5
Python and Edu-Blocks
• Python: Popular programming language
• Edu-Blocks: Block-based coding tool
• Available online: [Link]
• Supports Python, HTML, Raspberry Pi
Using Edu-Blocks

• Use 'Python 3' mode to start


• Click 'Start Coding' to open the editor
• Blocks on the left, Python code on the right
Interface of Edu-blocks
• The Edu Blocks Interface is simple.
• On the left we have all of the blocks we can
use to write code.
• The blocks are placed in the coding area on
the left of the screen.
• On the right we can see the generated Python
code
Building a sequence of code
• We write Python code using the blocks on the
left.
• The blocks click together like Scratch Blocks
are organized in the menu by their function.
• Blocks can be taken apart and put back
together.
• Run the code: The run our code we click the
Blue run button. This shows the output on the
right of the screen.
Turtle in Edu-blocks
Turtle is a Python graphics library used to draw
shapes, patterns, and pictures using a "turtle" that
moves on the screen.
• Turtle is used to teach coding through visual
drawing with blocks that control:
• Movement
• Turning
• Pen up/down
• Colors
• Shapes
• [Link](100)
• [Link]('red')
• turtle.begin_fill()
• turtle.end_fill()
Triangle
Square

4
Pentagon
Circle
Rectangle
Star
Octagon
Worksheet: Fill in the Blanks
• 1. _________ an action based on a
decision/test
• 2. Python is a _________ language
• 3. EduBlocks is a block-based app like
_________
• 4. EduBlocks is based on ________
Ans:
Section – highlevel – scratch - python
Write code for an octagon with yellow
background and red inside
Write code for a decagon
• Fill in the Blanks:
• 1. Selection


2. Programming
3. Scratch
Answers
• 4. Python

• Octagon code:
• import turtle
• wn = [Link]()
• [Link]("yellow")
• t = [Link]()
• [Link]("red")
• for i in range(8):
• [Link](100)
• [Link](45)

• Decagon code:
• for i in range(10):
• [Link](100)
• [Link](36)

You might also like