OOP-Q1

OOP-Q1

University

10 Qs

quiz-placeholder

Similar activities

Chapter Quiz

Chapter Quiz

University

10 Qs

The Linux Vault

The Linux Vault

University

15 Qs

Introduction to Computer Science, Group 1,

Introduction to Computer Science, Group 1,

University

10 Qs

ITEC 70 - Quiz # 2

ITEC 70 - Quiz # 2

University

15 Qs

 Chapter 5 Database Management Quiz

Chapter 5 Database Management Quiz

University

10 Qs

MongoDB Concepts 1

MongoDB Concepts 1

University

10 Qs

1st Quiz

1st Quiz

University

14 Qs

G4-Microprocessors and Their Uses

G4-Microprocessors and Their Uses

4th Grade - University

15 Qs

OOP-Q1

OOP-Q1

Assessment

Quiz

Information Technology (IT)

University

Practice Problem

Medium

Created by

Jhun Brian Andam

Used 2+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What does a class represent in OOP?

A specific instance of an object

A blueprint for creating objects

A method inside an object

A variable inside an object

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which keyword is used to define a class in Python?

`object`

`self`

`class`

`define`

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Media Image

Which of the following is an instance of the `Car` class?

Car("Toyota")

class Car: pass

def Car(): pass

"Car"

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is the purpose of the `__init__` method in Python?

It is a destructor for objects.

It initializes the attributes of a class.

It creates a new instance of a class.

It is used to create private variables.

5.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Media Image

Identify the correct syntax to access an attribute of an object.

dog1[name]

dog1::name

dog1.name

dog1->name

6.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Media Image

What will the following code output?

`Hello, Alice!`

Hello, {self.name}!

greet()

None

7.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which statement about inheritance in Python is correct?

A class can inherit from multiple parent classes.

Only one class can be inherited at a time.

Inheritance is not possible in Python.

Parent classes cannot have methods.

Create a free account and access millions of resources

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?