N010 Introduction To Programming and Python (Including Imports)
N010 Introduction To Programming and Python (Including Imports)
(including imports)
There isn’t just one way of doing this , of course, but these narratives provide a suggested
“story line” that can be used for each of the key topics.
1
– write each word on a separate line. Ask them what the squiggly red underline means -
not a Python word
– towards the end write one of two Python words to show that no underline appears
• Clear screen. Python has about 100 words that we can use out of the box, however Python
can do a lot more than this. Python has a library, like the one they have at school, where it
keeps all the commands it can do.
• To use these we need to use import
– import turtle means: dear Python, go to the library and get me the set of commands
called turtle. Later we will describe this as a box with commands in it (see /N100 Boxes
on shelves analogy/)
• fred = turtle.Turtle() suggest to always say “turtle dot Turtle brackets” to get them to
remember the brackets (avoid using parenthesis please, although technically more correct)
– this line does two things:
◇ creates a turtle (the turtle.Turtle() part)
◇ names it (the fred = part)