Search Header Logo

PY3 - <class>

Authored by Aim Sity

Computers

9th - 12th Grade

PY3 - <class>
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

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

Access all questions and much more by creating a free account

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

Already have an account?