Exception Handling modules and libraries
Reading Files:
Funzies
Arrays
OOP
100

What kind of errors does exception handling prevent when implemented correctly?



Runtime

100

What does this line of code do?  print(fr.readline());

readline() will read one line from the file

100

 Where is professor Lu from



China

100

How do you spell aray

A R R A Y

100

What is a “template” or “blueprint” of an object called in Python?



 Class



200

What modules do you have to import to check if a file exists or not? 


Os, Sys



200

What is “reader”? (slide 4)

An object



200

What is the output for this code block? (slide 7)

a + b is [1, 2, 3, 4, 5, 6, 7, 8];



200

What method do you use to add an element to a list 



.append()



200

What is a function tied to an object called in Python?



Method



300

What are the two built in keywords for exception handling in Python?

Try, Except



300

What does line 44 do? (slide 5)

read the column header

300

What is the output on line 200? (slide 8)

[1, 3, 4, 5]



300

How do you reference an element located at 3rd column, 4th row, of the array “student”?



student[3][2]



300

How do you declare the constructor method in Python?



 def __init__():



400

What is the output? (Slide 3) 

The system is experiencing technical difficulties. Please contact your system administrator or try again later. Bye! ============End of program



400

What does newline='' do?



Prevents extra blank rows and correctly handles newlines with quotes

400

Explain the difference between an array and a list and when to use each



Let the class be the judge 

400

What is the output on line 201? (slide 9) 



now length of a is 4



400

What parameter must every instance method in Python have?



self

500

Is it possible to catch multiple different kinds of exceptions and handle them in seperate ways?

Yes ( it is possible to handle multiple exceptions using one try: and multiple except: as long as you specify)

500

What is line 46 - 47 doing? (slide 6)

Iterates over the reader object and adds each row to the end of the distance list.



500

What color is the grass?

green

500

Explain pass by value and pass by array (When do you use each case)



Let the class be the judge 

500

Explain how object oriented programming works in terms of your favorite video game



Let the class be the judge