1. Consider the following program:
class Foo:
def __init__(self, q):
self.name = q
print(self.name)
a = Foo("zoo")
What will print when this program is run?
A) Zoo
B) Nothing
C) Program will crash
2. Consider the following program:
class Foo:
def __init__(self, q):
self.name = q
print(self.name)
What will print when this program is run?
A) Nothing
B) Program will crash
C) Zoo
3. Consider the following program:
class Foo:
def __init__(self, q):
self.name = q
def hi(self):
print(self.name,"!")
a = Foo("zoo")
b = Foo("bar")
c = Foo("goo")
b.hi()
What will print when this program is run?
A) Program will crash
B) Zoo !
C) Bar !
D) Nothing
E) goo !