PY3 - <class>

PY3 - <class>

9th - 12th Grade

5 Qs

quiz-placeholder

Similar activities

Python Orientado a Objetos

Python Orientado a Objetos

12th Grade - University

10 Qs

Object Oriented Programming

Object Oriented Programming

12th Grade

8 Qs

Alice 2 - Chapter 4

Alice 2 - Chapter 4

7th - 12th Grade

10 Qs

CSA Code.org Unit 2: Lesson 1 Attributes

CSA Code.org Unit 2: Lesson 1 Attributes

11th Grade

7 Qs

Classes and Object oriented programming

Classes and Object oriented programming

10th Grade

6 Qs

CodeHS 4.5 Writing Classes and Instance Methods

CodeHS 4.5 Writing Classes and Instance Methods

9th - 12th Grade

6 Qs

CodeHS 4.11 Primitives vs Objects

CodeHS 4.11 Primitives vs Objects

9th - 12th Grade

8 Qs

GitHub Jan12

GitHub Jan12

11th Grade - University

10 Qs

PY3 - <class>

PY3 - <class>

Assessment

Quiz

Computers

9th - 12th Grade

Hard

Created by

Aim Sity

FREE Resource

5 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Media Image

What will be the output ?

A) <class 'ExampleClass'>

B) <class '__main__.ExampleClass'>

C) <class 'object'>

D) <class 'int'>

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is self in the init method?

A) A built-in function

B) A reference to the current instance of the class

C) A global variable

D) A reserved keyword in Python

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Media Image

What happens if you remove self from the init method?

A) The program will still run normally

B) Python will raise a TypeError

C) The class will work but won't store any values

D) The value will be assigned to the class instead of the instance

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is the purpose of the init method in a class?

A) It creates a new object of the class

B) It is a special method used for initialization of instance variables

C) It prints the values inside a class

D) It destroys an object from memory

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What is the output for this code ?

5

10

Error

None