...

Modern Art

As part of this project you will learn:

What is computer programming (coding)?
Computer Programming or Coding is the process of writing instructions for a computer to follow. It's like a recipe, but for a computer. The instructions tell the computer what to do and in what order to do it.

Those sets of instructions that the computer follows to do something are written in a Programming Language.

Next
Python Programming Language

We will be learning a text-based programming language called Python.

Why Python?

  • It's perfect for beginners.
  • It's easy to setup.
  • It's powerful
  • It's can be used for graphics, animations, web applications, games, etc.
  • What is Trinket?

    During our Coding Classes, we will be using Trinket. Trinket is an online version of code editor where students can write and run their code online. Trinket is available online at trinket.io.

    Python Syntax

    Python has a simple syntax similar to the English language. Understanding the basic symbols in programming is important. We will frequently come across these symbols in our coding classes.


    Prev Next
    Please ensure all required fields are filled in
    Step 1: Saying hello
  • Open the blank Python template trinket: Open New.
  • Type the following into the window that appears:
  • Prev Next
    Please ensure all required fields are filled in
    Step 2: Create a Turtle window
  • The first step is to import the Turtle module. Place import statements at the top of your code.
  • Next, define the screen and specify its dimension. Type the code as follows:
  • done() command must be the last statement in a turtle graphics program.
  • Let's add the background colour to the screen. Follow the code below:
  • The hideturtle() command will hide the cursor
  • Prev Next
    Please ensure all required fields are filled in
    Step 3: Let's explore Turtle Functions

    Now, let's explore some essential Turtle functions. We'll start by drawing a circle and filling it with a colour.
    We will use the following commands:

  • speed(number) - set the speed of your drawing from 0 to 10
  • goto(x,y) - Use this command to navigate the turtle to a specific coordinate on the screen. The (x, y) values represent the horizontal and vertical positions.
  • circle(size) - Draw a circle of selected size
  • color("colourName") - This command sets the colour of the turtle's pen or fill to the specified colour name, such as "blue" in our case.
  • begin_fill() and end_fill() - These commands mark the beginning and end of the shape that we want to fill with the selected colour.

  • Type the code as follows:

    Prev Next
    Please ensure all required fields are filled in
    Step 4: Draw a mulpitle circles

    We will be using a for loop, to draw multiple circles. For loop allows to perform repetative tasks

    In order to draw each circle on the different position we need to use the random module.

  • Now ,let's make circle size and color to be different each time
  • Prev Next
    Please ensure all required fields are filled in
    Step 5: Quiz Time Programming Language Quiz

    It's time to put your programming language knowledge to the test. We have an exciting quiz for you! Below is a list of programming language names, some of which are real, and others are fake. Your task is to distinguish between them.

  • For Quiz click the following button:
  • Programming Language Quiz

    Prev Next
    Please ensure all required fields are filled in
    Step 6: Complete and Share

    Submit your final project



    Copy your Trinket Url

  • Click Share->Link
  • Copy the link to share your code
  • Paste link into the field
  • Prev