Skip to content

Latest commit

 

History

History
27 lines (19 loc) · 350 Bytes

File metadata and controls

27 lines (19 loc) · 350 Bytes

What is the output of the following:

d = {"offset": None}
print(d.get("offset", 0))

What output does the following produce:

x = 0
y = 0
def f():
     x = 1
     y = 1
     class C:
         print(x, y)  # What does this print?
         x = 2
f()

Explain the concept of Duck Typing.

Name two principles of sound class design.