Class activity : Introduction to Python with turtles



Class activity : Introduction to Python with turtlesBefore you start download the starter program for this week from <your shared drive>Start Python by opening Idle – the default Python editorFile – Open - > Find starter_activity_sheet_one.py that you downloaded The program should look like the one belowTry and predict what the program will do347472092075“turtle” is a Python module with the commands you need so don’t forget this line!00“turtle” is a Python module with the commands you need so don’t forget this line!Use the programGo to Run – Run Module (or press F5) You are prompted to save – make sure to put .py on the end of your file nameSee if the Python program does what you would expectModify the programTry these exercises (tick them off as you do them) – see commands belowMake a triangle by changing the angle between the lines47885357086600Use penup() and pendown() to draw a square and a triangle with a space between themUse the circle() function to draw two circles, one inside the otherDraw the shape on the rightExtension: Draw some fireworks in different colours!Basic commandsforward() or fdGo forwardcircleDraw a circlebackwardGo backwardresetClear the screenrightTurn rightsetpostion(x,y)Move to position x yleftTurn leftpensize()Set the width of the brush/penpenup()Lifts the pen up so you can move the turtle without drawingshape(“turtle”)Change shape to a turtlependown()Drops the pen back onto the screen so you can drawshape(“circle”)Change the shape to a circlefillcolor(“Brown”)Changes the fill colour to brown(or other colour)stamp()Leave an impression of the shape on the screenbegin_fill()Begins to fill the shapepencolor(“Red”)Changes the pen colour to red (or other colour)end_fill()End the filling sequencewrite()Write some text Terminology for the concepts being learned in this exerciseSequenceFunctions (eg forward – this is a function that you call to move forward)Parameters (eg 90 in right(90) – you pass the data 90 into the function right)Tasks for next weekTry out one or more of the activities around developing algorithmic thinking with students (or colleagues!). Be ready to describe and whether it helped you to teach algorithms.Write a Python program using the Turtle library which draws a house (with windows!) ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download