wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

12/3 Classes & Objects

Total questions: 17

Worksheet time: 13mins

Name
Class
Date
1.

What are the attributes to the BankAccount class?

a)

Deposit & withdrawal

b)

owner & balance

c)

BankAccount

d)

string & Dollars

2.

What are the Class Name to the BankAccount class?

a)

Deposit & withdrawal

b)

owner & balance

c)

BankAccount

d)

string & Dollars

e)

I hate Mr. Bugusky

3.

What are the functions to the BankAccount class?

a)

Deposit & withdrawal

b)

owner & balance

c)

BankAccount

d)

string & Dollars

e)

I hate Mr. Bugusky

4.

What of the following is a callable function?

a)

radius

b)

getArea()

c)

center

d)

getCircumference()

e)

setCenter(3,4)

5.

What is an argument all classes need to initialize?

a)

self

b)

name

c)

class

d)

I hate mr. B

e)

keyword

6.

In the statement

Bank tom = Bank(5000.0);

Which is the class?

a)

Bank

b)

tom

c)

new

d)

5000.0

7.

In the statement

Bank tom = Bank(5000.0);

Which is the object?

a)

Bank

b)

tom

c)

new

d)

5000.0

8.
How many objects can be made from a class?  
a)
None, you make classes from objects
b)
one
c)
As many as you want
d)
All of the above
9.

What is a Python class?

a)

A function to create an object.

b)

A template (blueprint) for creating objects.

c)

A procedure related to an object.

d)

A process that repeats are directed.

10.

What is the keyword to create a class?

a)

import

b)

__int__

c)

class

d)

def

11.

Identify the code that properly creates an instance of a class named Car.

a)

camero.car(make, model)

b)

tesla = car.make()

c)

mustang = Car(make,model)

d)

porsche = car.make.model()

12.

Identify the initialization method for a Car class.

a)

class init(self, make, model):

b)

class__init__:

c)

def __init__(self, make, model):

d)

def __init__(self, make, model):

13.

What choice correctly defines a class called NFL_Player with attributes name and overall.

a)

class NFL_Player:

def __init__(self, name, overall):

self.name = name

self.overall = name

b)

class NFL_Player()

def __init__(self, name, overall):

self.name = name

self.overall = name

c)

class NFL_Player:

def __init__(name, overall):

self.name = name

self.overall = name

d)

class NFL_Player()

def __init__(name, overall):

self.name = name

self.overall = name

e)

I don't know.....

14.

Why do we make variable or objects global?

a)

So people on any part of the world can see it. Across the flat earth.

b)

Its good practice.

c)

They are temp and only exist inside the function or class that contains them. Therefore accessible anywhere.

d)
15.

Who would win a battle between, Darth Vader vs. Yoda?

a)

Darth Vader

b)

Yoda

16.

What is cooler, Mandalorian or Black Mirror?

a)

Mandalorian

b)

Capt. James T. Kirk

c)

No opinion

17.

Birthday = True

Is today Mr. Bugusky's birthday?

a)

Yes

b)

No

c)
d)