The first quiz will cover the following topics:
Programming, Python
Basic Syntax and Types
The quiz will consist of definitions, code evaluation, debugging, and programming sections.
Below are examples of the type of questions that may be asked on the quiz. It is meant to be representative, rather than exhaustive (ie. there may be questions that show up on the quiz that are not shown below).
Briefly define the following terms.
Program:
CPU:
Memory:
Interpreter:
Variable:
Syntax Error:
Expression:
Statement:
What is the result of the each of the following lines of Python code:
print '1' + 3.0
print '1' + "3"
print type(1 + 3)
print type(1 + 3.0)
What is the result of the following Python code:
x = 1
y = 2
x + y
print x, y
What is the result of the following Python code:
x = 1
y = 2
x = x + y
y = x + y
print x, y
side = raw_input(What is side?)
area of square = side ^ 2
print area of square
length
and width
of a rectangle
from the user, computes the area of a rectangle, and then prints the result:Length? 3
Width? 4
The area of a rectangle with length 3 and width 4 is 12.