At My Fingertips
Rapid Playground
Let's implement the rgb_dots
function that creates three rgb circles, and the cmy_squares
function that creates three cmy squares, to recreate the following graphics.
Circles and squares are just special kinds of ellipses and rectangles, for which PyTamaro provides functions.
In order to avoid calling the ellipse function, that takes a width and a height each time, let's implement a circle
function, that only needs a diameter
.
For the same reason, let's implement a square
function that only needs a parameter side
, to avoid calling the rectangle function that needs a width and a height each time.
Let's now implement the rgb_dots
function that returns three circles of the given circle_diameter
, each beside the other: one of color red, one green and one blue. Use the circle
function you defined above!
Lastly, let's implement the cmy_squares
function that returns three squares of the given square_side
, each beside the other: one of color cyan, one magenta and one yellow. Use the square
function you defined above!
This activity has been created by LuCE Research Lab and is licensed under CC BY-SA 4.0.
Base Colors
PyTamaro is a project created by the Lugano Computing Education Research Lab at the Software Institute of USI
Privacy Policy • Platform Version 0d7866a (Fri, 20 Dec 2024 07:46:38 GMT)