0% found this document useful (0 votes)
13 views2 pages

N010 Introduction To Programming and Python (Including Imports)

This document introduces programming and the Python language to new students. It suggests explaining that coding allows communication with computers through structured languages like Python. Python uses words, grammar, and punctuation similar to human languages but is unambiguous. The document recommends having students suggest English words they think may be in Python, then showing the difference. It introduces Python's built-in words and extensive libraries that add more capabilities through imports. As an example, it shows how to import and use the turtle library to create and name a turtle object.

Uploaded by

oj78692
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views2 pages

N010 Introduction To Programming and Python (Including Imports)

This document introduces programming and the Python language to new students. It suggests explaining that coding allows communication with computers through structured languages like Python. Python uses words, grammar, and punctuation similar to human languages but is unambiguous. The document recommends having students suggest English words they think may be in Python, then showing the difference. It introduces Python's built-in words and extensive libraries that add more capabilities through imports. As an example, it shows how to import and use the turtle library to create and name a turtle object.

Uploaded by

oj78692
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

N010 Introduction to Programming and Python

(including imports)

A note on these “narratives”

A key part of the CodeToday method is to clearly explain abstract/complex concepts in a


simple way, often using analogies and choosing words carefully to try to convey the ideas in a
way that best explains what is going on.

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.

Introducing programming/coding and Python (how to get started on


the first session of a course)

Ask students how they would explain what coding/programming is to someone?

• Coding is a way of communicating with a computer, tell it what to do.


• In order to communicate we need a language. In the same way that we all understand each
other because we all know English, we need a common language to speak with the
computer. There are many, Python is one of them.
• Why can’t we use English to speak to the computer?
– Human languages are meant for intelligent human beings and can be ambiguous – see
‘English v Python phrases’ pdf document in Instructor Resources Folder - you can show
this to group if you wish
– Programming language need to be unambiguous
• What do all languages (English, French, Spanish…) have in common?
– words
– grammar
– punctuation
• Open a blank Python file and ask them to give you any words in English that they think may
be in Python. (Note, if any student has then Python before ask them not to contribute to this
bit, for now)

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)

You might also like