Note 12.2.1. Material Covered.
Today’s lab focuses on getting Python and IDLE installed and working on your computer.
print(“Hello World”)
test.py
.py
files..py
file, you should run it to test it..py
files on UMLearn.import turtle
wn = turtle.Screen()
niki = turtle.Turtle()
lab_test.py
house.py
# draws bottom of house
niki.right(90)
niki.forward(128)
niki.left(90)
niki.forward(128)
niki.left(90)
niki.forward(128)
niki.left(90)
niki.forward(128)
# draws roof of house
niki.right(135)
niki.forward(90)
niki.right(90)
niki.forward(90)
################################
# First name Last name
# COMP 1000
# Week 1 Lab, Part 2
# Turtle house drawing
################################
.py
files with IDLE, right click on the file and select “Properties” from the context menu and then the “Change” button where it says “Open with..”import turtle
then press ’return’. Python imported the turtle module and is now ready to accept the next command (see the >>>).wn = turtle.Screen()
then press ’return’. Python creates and displays an empty turtle canvas and again the prompt >>> indicates that IDLE is ready for the next command.niki = turtle.Turtle()
and press ’return’. Python creates a turtle and displays it at the x,y coordinate (0,0) which is the center of the canvas. Again the >>> prompt appears.niki.forward(100)
.