Computer Science LearnITWithMrC ⛯ Year 7 Year 8 Year 9 GCSE
Responsive image

Let's Get ReaListic

What am I Learning today?

I am learning how to use python turtle to further develop understanding of functions in programming and be able to create simple functions that serve a single purpose.
I am learning how to use python turtle to create a splash screen

Knowledge Organiser

×

Lesson

Task 1 - Getting Started Click to see more

You are going to screenshot all of your work into a Powerpoint file.

To download the PowerPoint by clicking on the image below

To save your powerpoint go to: File explorer -> Year 9 Common Area:S -> You can save here -> Computer Science -> Term 1 -> Lesson5

Save the Powerpoint file: as your name


  • Complete Task 1 in your Powerpoint


  • Task 2 - Draw a circle Click to see more

    Draw a circle

    • Change the function below so that it draws a circle then add a line to call the function circle() and run the code.
    Note: Dont forget to indent the code properly!

    Turtle Box



  • Screenshot your python code and output into your Powerpoint


  • Task 3 - User Input Click to see more

    Entering data:

    If we want to get some data from the user we can use pythons input, however if we want our input to be in a popup box we need to use some turtle code.

    import turtle
    tim = turtle.Turtle()
    screen = turtle.Screen()
    screen.bgcolor("white") 
    screen.title("User Input")
    
    # This is how we get user_input using a pop up box
    name = screen.textinput("Turtle Program", "Enter your name")
    
    #This is how we change the position of the text
    turtle.setposition(0, 0)
    
    #this is how we can write the text input to the screen
    turtle.write(name)
    

    We can then style our text using the code below

    style = ('Courier', 30, 'italic')
    turtle.write('Hello!', font=style, align='center')
    
    Lets try the following tasks:

    Tick each task when you have successfully done it in the following list:

    Complete the following tasks

    Make a new Python program, that asks for the users name and age.
    Output their name and age to the screen
    Click on Run then Run module or press F5

    • We can also get a user to enter a number by using numinput instead of textinput

    Extension task:

    Tick each extension task when you have completed it in the following list:


    Make your text bigger.
    Change the font of your text
    Draw a box around your text
    Use numinput for age


  • Screenshot your python code and output into your Powerpoint


  • Task 4 - Using input for Parameters Click to see more

    Lets go:

    • Last lesson we looked at how to pass in a parameter to a function. The code below allows us to create a shape by setting the value of the variable num_of_sides in our code and then passing it into our shape function:
    import turtle
    
    def drawShape(sides):
        
        for x in range(sides):
            tim.forward(120)
            tim.left(360/sides)
            
    screen= turtle.Screen()
    screen.bgcolor("white") 
    screen.title("Super Shapes")
    
    tim = turtle.Turtle()
    
    num_of_sides = 6
    
    for myMove in range(8):
        drawShape(num_of_sides )  # Draw the shape with 'num_of_sides ' sides
        tim.left(360/8)
    
    
    wn.mainloop()
    


  • Can you change the code above so you use user input to enter the number of sides and then print out that shape?
  • Lets try the following tasks:

    Tick each task when you have successfully done it in the following list:

    Complete the following tasks

    Use user input to ask for the size of the shape and then use that input to set the size of the shape.
    Can you use your text input function to ask for a colour to change the colour of your shape
    Add line thickness or change the number of times the loop runs to make a complex pattern of your own.


  • Screenshot your python code and output into your Powerpoint


  • Task 5 - Making a splash Click to see more

    Try coding some of these:

    Lets try the following tasks:

    Tick each task when you have successfully done it in the following list:

    Complete the following tasks

    Create python code for a splash screen
    Put a welcome message on there
    Use colours and shapes to make it interesting.


    pattern1.png

    pattern1.png


  • Screenshot your python code and output into your Powerpoint

  • Task 6 - Lesson Review/Homework Click to see more


    Summing it all up

    Lets look at the learning outcomes and decide which one best describes our current level of understanding :

    Tick the one you feel is closest to your level

    Learning Outcomes I need to learn how to use python turtle to create a splash screen

    • I have a basic understanding of how I can use python turtle to create a splash screen with a little help from my teacher
    • I can show my teacher that I can use python turtle to create a splash screen without their help.
    • I can use python turtle to create a splash screen independently and I can also explain it to others and can complete any extension tasks I am given.

    🠜 Now update your learning objectivesClick on the Assessment image



    My Notes: Coding_Turtle

    Student_Comment_1 not found

    Task Notes/Comments - Add here Click to see more

    Comments/Notes