Advanced Python Assessment

Advanced Python Assessment

9th - 12th Grade

30 Qs

quiz-placeholder

Similar activities

ULANGAN BAB ALGORITMA PEMROGRAMAN KELAS 8

ULANGAN BAB ALGORITMA PEMROGRAMAN KELAS 8

8th Grade - University

25 Qs

Digital Literacy Quiz ( Kuis Literasi Digital)

Digital Literacy Quiz ( Kuis Literasi Digital)

9th Grade

25 Qs

Ulangan Logika Dasar Matematika

Ulangan Logika Dasar Matematika

10th Grade

25 Qs

SAS 1 Informatika 8

SAS 1 Informatika 8

8th Grade - University

25 Qs

Seni Budaya Quiz

Seni Budaya Quiz

11th Grade - University

25 Qs

1-kurs 1-semestr YAKUNIY 2025

1-kurs 1-semestr YAKUNIY 2025

10th Grade

25 Qs

UTS INFORMATIKA KELAS E

UTS INFORMATIKA KELAS E

8th Grade - University

25 Qs

Materi Berpikir Komputasional Kelas 10

Materi Berpikir Komputasional Kelas 10

10th Grade

25 Qs

Advanced Python Assessment

Advanced Python Assessment

Assessment

Quiz

Information Technology (IT)

9th - 12th Grade

Practice Problem

Hard

Created by

Huda Learns

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

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

30 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the purpose of the __init__ method in a Python class?

To initialize instance variables when an object is created
To define class methods
To create static methods
To handle exceptions

Answer explanation

__init__ is the constructor method that initializes instance variables when an object is created.

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following demonstrates proper inheritance syntax in Python?

class Child(Parent):
class Child extends Parent:
class Child inherits Parent:
class Child -> Parent:

Answer explanation

Python uses class Child(Parent): syntax for inheritance.

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What will this code output?

10
20
Error
None

Answer explanation

The child class B overrides the class variable x, so obj.x returns 20.

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which method is automatically called when an object is about to be destroyed?

__del__
__destroy__
__remove__
__cleanup__

Answer explanation

__del__ is the destructor method called when an object is about to be destroyed.

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What does super() do in Python inheritance?

Creates a new superclass
Calls methods from the parent class
Prevents inheritance
Defines abstract methods

Answer explanation

super() allows you to call methods from the parent class in the child class.

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of these is a private attribute in Python?

_variable
__variable
private_variable
variable_

Answer explanation

Double underscore prefix (__variable) makes an attribute private through name mangling.

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is method overriding in Python?

Creating multiple methods with same name
Redefining a parent class method in child class
Calling parent methods
Creating static methods

Answer explanation

Method overriding is redefining a parent class method in the child class with the same name.

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?