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
15 questions
Kuis Pengetahuan Dasar Statistika B

Quiz
•
University
20 questions
Quiz-1

Quiz
•
University - Professi...
15 questions
Soal Pilihan Ganda Tumbuhan

Quiz
•
4th Grade - University
20 questions
Business Mathematics | Trade and Cash Discount

Quiz
•
University
19 questions
Soal Bentuk Aljabar

Quiz
•
8th Grade - University
20 questions
2. Ayo Main Quiz Lagi

Quiz
•
University - Professi...
15 questions
UTS Statistik Dasar

Quiz
•
University
15 questions
QUIZ PKM 2024

Quiz
•
University
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