13
Lesson 10 of 44

Geometric shapes

In this lesson, you will explore how to use programming to create and draw various geometric shapes on the screen, from simple squares and rectangles to more complex figures. Enhance your programming skills with this enjoyable lesson of practical exercises in Python.

  • 3 theory articles
  • 10 practice exercises
Start lesson

Fundamentals concepts 3

Drawing with text: rows and columns

The exercises in this lesson draw shapes in the console using only characters. You do not need anything new from Python: they are…

Theory
Read more

How to think about a shape: the formula for each row

Triangles and pyramids look hard, but they have a trick: in each row there is a number of spaces and a number of symbols that can…

Theory
Read more

Hollow shapes and text graphs

Until now each row was built with a single formula. In hollow shapes, the top and bottom rows are different from the middle ones…

Theory
Read more

Practice exercises 10

Square

Write a Python program that prompts the user for two integers. The first number x is used to draw the square on the screen, the…

Exercise Easy
Solve it

Rectangle

Write a Python program that prompts the user for three integers. The first number x is used to draw the area of ​​the rectangle…

Exercise Easy
Solve it

Draw a hollow square

Write a program in Python that asks the user for a symbol and a width. You will use these to draw a hollow square of the given…

Exercise Medium
Solve it

Triangle Rectangle

Write a Python program that prompts the user for two integers, the first being an integer x which is used to draw the area of…

Exercise Medium
Solve it

Draw a hollow rectangle

Write a program in Python that asks the user for a symbol, a width and a height to draw a hollow rectangle with those dimensions.

Exercise Medium
Solve it

Draw a parallelogram

Create a program in Python that draws a parallelogram with the width, height, and character requested by the user.

Exercise Medium
Solve it

Triangle Rectangle String

Write a Python program that asks the user for a text x and draws a right triangle like the one in the example. The first row of…

Exercise Medium
Solve it

Triangle Rectangle Mirror

Write a Python program similar to the triangle rectangle exercise. In this exercise, ask the user for two integers, the first is…

Exercise Medium
Solve it

Draw a pyramid

Create a Python program that asks the user for text and draws a pyramid on the screen.

Exercise Medium
Solve it

Graphic of a Function

Create a program Python to draw the graphic of the function y=(x-4)² for a range of integer values of x requested from the user.

Exercise Medium
Solve it