Apa tujuan dari konstruktor dalam Python?

Quiz on Constructors and Destructors in Python

Quiz
•
Computers
•
11th Grade
•
Easy
007_Yazid Rizki
Used 2+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Untuk menginisialisasi objek saat dibuat
Untuk memvalidasi data input
Untuk menghapus objek dari memori
Untuk membuat kelas baru
2.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Metode mana yang digunakan sebagai konstruktor di Python?
__del__
__init__
__new__
__call__
3.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Apa yang terjadi jika konstruktor menerima nilai usia negatif?
Eksepsi ValueError terjadi
Objek dibuat dengan usia default
Usia diatur menjadi nol
Program mengalami crash
4.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Apa peran dari destruktor dalam Python?
Untuk membuat instance baru dari sebuah kelas
Untuk memvalidasi input pengguna
Untuk membersihkan sumber daya sebelum objek dihapus
Untuk menginisialisasi atribut objek
5.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Apa nama metode destruktor di Python?
__init__
__del__
__close__
__exit__
6.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Apa yang diinisialisasi oleh konstruktor kelas AkunBank?
Pemilik dan saldo awal
Riwayat transaksi dan biaya
Nomor akun dan kata sandi
Suku bunga dan jumlah pinjaman
7.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Apa masalah potensial dengan destruktor di Python?
Mereka hanya dapat membersihkan file
Mereka mungkin tidak dipanggil jika ada referensi melingkar
Mereka tidak dapat didefinisikan dalam sebuah kelas
Mereka selalu dipanggil segera
Create a free account and access millions of resources
Similar Resources on Quizizz
20 questions
KELAS DKV 1 PTS PLD SEMESTER 2

Quiz
•
11th Grade
23 questions
Uji Pengetahuan Microsoft Office dan keyboard

Quiz
•
10th Grade - University
20 questions
PTS PHP OOP Dasar Adi W

Quiz
•
9th - 12th Grade
20 questions
Pemahaman Dasar tentang Data

Quiz
•
11th Grade
15 questions
Blogger

Quiz
•
10th - 12th Grade
15 questions
Panduan Pembuatan Blog di Blogspot

Quiz
•
9th Grade - University
20 questions
Quiz tentang Tools CorelDRAW

Quiz
•
11th Grade
20 questions
UTS KOMPUTER AKUNTANSI

Quiz
•
9th - 12th Grade
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
Discover more resources for Computers
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
17 questions
Parts of Speech

Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression

Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing

Quiz
•
9th - 12th Grade
10 questions
Identifying equations

Quiz
•
KG - University