Attributes
Polymorphism
Code Analysis
100

The description of an attribute.

What is a variable that stores data about an object.

100

True or False: In polymorphism, two classes can have methods with the same name but different behaviors.

What is True?

100

The output of this code:

class Student:

    def __init__(self):

        self.grade = 11


s = Student()

print(s.grade)

What is 11?

200

An example of an attribute in a Student class.

What is a Name, grade level, student ID, or GPA.

200

The term for redefining a method in a subclass.

What is Method Overriding?

200

The output of this program:

class Animal:

    def speak(self):

        return "Sound"

class Dog(Animal):

    def speak(self):

        return "Woof"

d = Dog()

print(d.speak())

What is Woof?

300

Attribute that an Employee class might have that would identify a worker.

What is an Employee ID or Position.

300

A Shape class has a method called draw(). The subclasses Circle, Square, and Triangle each define their own version of draw(). The Object Oriented Program concept demonstrated is

What is Polymorphism

300

The parent class of this code:

class Person:

    pass

class Teacher(Person):

    pass

What is Person?

400

A car class has the attributes make, model, and year. Which of these attributes would most likely change when creating different Car objects.

What is any of them.

400

The code output is:

class Bird:

    def speak(self):

        return "Chirp"

class Duck(Bird):

    def speak(self):

        return "Quack"


class Owl(Bird):

    def speak(self):

        return "Hoot"

animals = [Duck(), Owl(), Bird()]

for a in animals:

    print(a.speak())

What is Quack Hoot Chirp?

400

The output of the code is:

class Person:
    def introduce(self):
        return "I am a person"

class Student(Person):
    def introduce(self):
        return "I am a student"

p = Student()
print(p.introduce())

What is I am a student?

500

The point of attributes is

What is making code easier to manage, reuse, and maintain. 

500

Polymorphisim is useful in programming for this reason.

What is making programs more flexible and reusable?

500

What is the object oreinted programming concept demonstrated by this code:

class Vehicle:

    def move(self):

        return "Moving"

class Car(Vehicle):

    def move(self):

        return "Driving"

class Boat(Vehicle):

    def move(self):

        return "Sailing"

What is Polymorphism?