INTERACTIVE ONLINE COURSE

Python 3

FOR BEGINNERS


"The first Python course that simply amazed me. Very well explained and easy to understand." (Alexandru Cosmin)

"The best Python course in Romania." (Iulian Geană)


ALL REVIEWS
LESSON 6
PAGE 3 / 4
Learning with Turtle!
Home >>> Online Lessons, Python 3

Drawing a Circle

What would the Babylonians have given thousands of years ago to have access to the function circle(diameter)... right?

One of the benefits of modern programming languages is quick access to basic elements, "without reinventing the wheel":
Editor - lesson_6.py
       
Graphical Mode in Python done
Console/Output done
EXERCISE

Try to create a figure similar to the one below:



Draw as many circles as you want, in different colors!

Pen Thickness

Another useful function is pensize(pixels), which allows us to set the thickness of the drawn line.

For example, test in the code:

t.pensize(5)

SMALL PROJECT

Create a program that reads the dimensions of a rectangle and the desired color from the user via the keyboard, then draws it graphically.
Try to solve the proposed exercises,
then proceed to the next page.
 home   list  CONTENTS   perm_identity   arrow_upward