Apa yang menjadi output dari kode Python berikut?
my_list = [1, 2, 3, 4, 5]print(my_list[1:3])
Algo Python

Quiz
•
Mathematics
•
University
•
Hard
Edy Wihardjo
Used 54+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
20 sec • 10 pts
[1, 2]
[2, 3]
[3, 4]
[2, 3, 4]
2.
MULTIPLE CHOICE QUESTION
20 sec • 10 pts
Apa yang akan terjadi jika Anda mencoba menggabungkan (concatenate) dua tipe data yang berbeda dalam Python?
Akan menghasilkan error.
Akan menghasilkan hasil penggabungan yang tidak terduga.
Tidak akan terjadi apa-apa, Python akan mengubah tipe data secara otomatis.
Akan menghasilkan nilai None
.
3.
MULTIPLE CHOICE QUESTION
20 sec • 10 pts
Berikut ini adalah contoh fungsi dalam Python:
def calculate_sum(a, b):
return a + b
Bagaimana Anda memanggil fungsi tersebut?
calculate_sum(a, b)
calculate_sum
calculate_sum(a + b)
sum(a, b)
4.
MULTIPLE CHOICE QUESTION
20 sec • 10 pts
Apa hasil dari eksekusi kode Python berikut?
x = -10
y = 5
if x > y:
print("x lebih besar dari y")
elif x < y:
print("x lebih kecil dari y")
else:
print("x sama dengan y")
x lebih besar dari y
x lebih kecil dari y
x sama dengan y
Tidak ada output yang dihasilkan.
5.
MULTIPLE CHOICE QUESTION
20 sec • 10 pts
Apa output yang dihasilkan oleh kode Python berikut?
my_dict = {"nama": "John", "umur": 25, "pekerjaan": "programmer"}
print(len(my_dict))
0
1
2
3
6.
MULTIPLE CHOICE QUESTION
20 sec • 10 pts
Apa yang dilakukan oleh metode
.append()
dalam Python?
Menghapus elemen terakhir dari sebuah list.
Menambahkan elemen baru pada akhir sebuah list.
Mengurutkan elemen-elemen dalam sebuah list.
Menggabungkan dua list menjadi satu.
7.
MULTIPLE CHOICE QUESTION
20 sec • 10 pts
Apa yang akan menjadi output dari kode Python berikut?
my_string = "Hello, World!"
print(my_string[::-1])
"Hello, World!"
"!dlroW ,olleH"
"!dlroW ,olleH!"
SyntaxError
Create a free account and access millions of resources
Similar Resources on Quizizz
20 questions
2. Ayo Main Quiz Lagi

Quiz
•
University - Professi...
20 questions
Bertelsmann AI Track Quiz Initiative #3

Quiz
•
University - Professi...
25 questions
ADP KUIS 4

Quiz
•
University
15 questions
UTS Statistik Dasar

Quiz
•
University
15 questions
Hiburan

Quiz
•
KG - University
20 questions
Solusi Proyek Kucing

Quiz
•
4th Grade - University
15 questions
QUIZ PKM 2024

Quiz
•
University
20 questions
PYTHON-MCQ

Quiz
•
University
Popular Resources on Quizizz
15 questions
Multiplication Facts

Quiz
•
4th Grade
25 questions
SS Combined Advisory Quiz

Quiz
•
6th - 8th Grade
40 questions
Week 4 Student In Class Practice Set

Quiz
•
9th - 12th Grade
40 questions
SOL: ILE DNA Tech, Gen, Evol 2025

Quiz
•
9th - 12th Grade
20 questions
NC Universities (R2H)

Quiz
•
9th - 12th Grade
15 questions
June Review Quiz

Quiz
•
Professional Development
20 questions
Congruent and Similar Triangles

Quiz
•
8th Grade
25 questions
Triangle Inequalities

Quiz
•
10th - 12th Grade