1.6. Chapter Summary¶
Chapter 1 included the following concepts from computing.
Code - Code is a set of instructions that a computer can understand. This is sometimes called a program.
Comment - Comments explain what we’re doing in the programs and are intended to be read by people, not computers. In Python a comment starts with
#. The computer will ignore everything from the start of the comment to the end of that line.
Dot-Notation - Dot-notation is how you ask an object to do something in Python. You use the name of the object followed by a dot (period) and then followed by what you want it to do and then any values in parentheses. For example to return a new string will all lowercase letters from a variable called
sentence.lower(). To ask a turtle named
alexto go forward 50 units use
Library - A library is a group of programs that provides some functionality. The
Turtlelibrary is a good example. It lets us create and work with
Pixel - A pixel is one small part (element) of a picture. Pixels are stored in a grid and have both x (horizontal) and y (vertical) values. A pixel has a color which can be defined by an amount of red, green, and blue with values from 0 to 255.
Program - A program is a set of instructions that a computer can understand to accomplish some goal. This is sometimes called code.
Screen - A
Screenis part of the Turtle library. It is a space on the page for the turtle to move in and draw on.
String - A string is anything we can type between a pair of pair of single quotes (
'Hi'), double quotes (
"Hi"), or triple quotes (
'''Hi'''). It is a sequence of characters.
Variable - A variable is a name associated with computer memory that can hold a value and that value can change or vary. One example of a variable is the score in a game.