Variable Types
Python Operators and Their Use
Programming Techniques
Potpourri
Name that function()
100

This type of variable represents whole numbers (e.g., 1, 2, 3..)

Integer

100

What is the operator = and what does it do?

Assignment - stores a value (e.g., x=5, means store the value 5 as x)

100

Programmers include comments in programs to ...

Explain how code operates

100

If you need to do the same thing a certain number of times, you should use a ______ loop.

FOR

100

This function lets the user type something in.

Input()

200

This type of variable represents only two values (i.e., TRUE or FALSE)

Boolean

200

What is this operator?

  ==

Compare to. Check if two things are the same.

200

What is a function?

A named block of code that performs a specific task and can be reused

200

This type of error occurs when a program does not follow the requirements of the programming language

A syntax error

200

This function displays output to the user

print()

300

This type of variable stores a sequence of characters (e.g. "The quick brown fox jumps over...")

String

300

What does IF do?

Checks a condition, and only does the step if the condition is true

300

How many total times will Karel move in this program?

6

300

If you need to do something for as long as a condition exists, you should use a _______ loop

While 

300

Use this function to determine the type (e.g., string, int, float) of a specified variable

type()

400

This type of variable represents a number with a decimal part (e.g. 3.1415).

Float

400

What does ELSE do?

ELSE comes after an IF, and it is performed when the IF is not performed.

400

This is how you make a comment in python

Put a # at the start of the line.

Alternatively put """ at the start and """ at the end of a comment. This can make a comment cover multiple lines

400

If you need to determine whether something is true before doing something, you should use an ______ statement

IF

400

This keyword is used to define a function in Python

def

500

This type of variable stores a collection of items as a single variable (e.g., ages =[16, 26, 29])

List

500

What is this operator?

/

Division

500

What will be the output of this program?

5

500

This keyword is used to define a function in Python

Def
500

This built-in Python function generates a sequence of numbers often used in loops, such as 0, 1, 2.

range()

M
e
n
u