Apply your knowledge to build something amazing!
Go to EduBlocks page and login with your Google account: https://app.edublocks.org/login
Everytime you want to start a new project, click on the "Editor" icon. To resume your project, click on the "Projects" icon.
Note: Make sure you have the habit of saving once in a while to avoid losing progress.
Using the Python Turtle Graphics Library, we will let it randomly create a work of art!
How do we do that? First, we will recap on how a function works and create a function that produces a random circle that has a random size, position and colour! Lastly, repeat with loops!
For our first artwork, we can go for simple circles in pastel colours :sparkles:
One. Import these modules:
2. Declare initial values:
3. Define a function called drawCircle:
4. Finally, let's call the function in a loop to repeat 30 times. For i in the range of 1 to 30:
For the advanced version of the project, let's have another function to draw random squares.
Notice that if we have 2 functions for drawing circles and squares, there are repeated codes. Those repeated codes should be placed in a separate function.
One. Define a function called drawSquare and use a loop inside the function to draw the square.
2. Now that you have both the drawSquare and drawCircle, you should be able to see some similar repeated codes.
3. Finally, your for loop can be used to call the drawSquare and drawCircle 20 times.
Functions can also be called within a function.
Make sure your My Picasso Art project includes:
When you have completed your "My Picasso Art" project, submit it using the link below: Submit Your Project Here Make sure to test your program before submitting to ensure all required elements are working properly!
Note: You need to submit 1 project link for this project - the advanced version which incorporates all the concepts from the basic version.