Read it and Weep
Feelin Loopy
Philosophical Design
List it or Miss it
Call me Maybe
100

What module/library must you import to read CSV files?

csv

100

This method often used with for loops, allows us to loop through set boundaries.

range()

100

Python is a _______ language, meaning user community freely participates in defining the language and creating new interpretations of its Syntax.

open-source

100

What is the output of the following code?

myList = [1,2,3]

print(myList[3])

IndexError

100

This type of function is also referred to as a setter

Mutator

200

This method, often associated with File I/O, is used to strip specific characters like white space from the BEGINNING of a string.

lstrip()

200

Name 2 issues from the following code-

for i in range(5)

Print(i)

Missing colon

'p' in print should not be capitalized 

200

To test against program crashes, we should generate ______ test inputs and verify their outputs.

Negative

200

What is the difference between a list and a tuple?

A list can be changed once created, tuple cannot.

A tuple has a specific order to their items, list does not

200
_____ Scope refers to the range variable that can be used anywhere in a program and across multiple functions.

Global

300

What are the 2 types of files that python allows a programmer to work with?

text files and binary files

300

In loops (for/while) we often use variable names such as "i" or "j" to represent what term denoting what numbered loop we are currently on

Iterator/Iteration

300

In a flowchart, this symbol is often used to return or end a function.

Oval/Ellipse

300

What is the output of the following code?

myList = [1,2,3]

print(myList(3))

TypeError

(Python thinks "myList" is being called as a function, its a variable, not function, thus wrong type)

300

This symbol is used to create an arbitrary dictionary parameter for a funciton.

**

400

This file mode allows us to do reading AND writing at the same time.

r+ or w+ or a+
400

Loops are often used to create what kind of algorithms for lists?

Sorting and Searching

(either will be accepted)

400

Describe what happens when a piece of data is written to a file?

Data is copied from a variable in RAM to a file.

400

What is the new value of our List after the following code runs?

my_list = [1,3,5]

my_list = my_list[0] * 3

3

400

What's the difference between an argument and a parameter of a function?

Parameter: a variable created in a function header that RECEIEVES an argument.


Argument: a variable used in a function call that SENDS the value to the parameter.

500

What is the output of the following code?

f = open("data.txt", "w")
f.write("Hellow")
f.close()

f = open("data.txt", "w")
f.write("World")
f.close()

f = open("data.txt", "r")
print(f.read())

World

500

Try-excepts, often times provide a higher level of ______ than loops. As we need to handle riskier situations.

Validation

Input Validation.

500

Two programs produce the same correct output. One is written in 20 lines, the other in 200 lines. Which of the two is GENERALLY considered the better design, and why?

20 lines. Because smaller code typically means easier to read, maintain, and debug if there are issues.
500

Lists are ______, meaning their elements can be changed and the object is updated throughout the entirety of a program.

Mutable

500

To refer to a function being called from an imported module, Python uses ____ notation

.

dot

module.function()

M
e
n
u