Algo Python
Quiz
•
Mathematics
•
University
•
Practice Problem
•
Hard
Edy Wihardjo
Used 54+ times
FREE Resource
Enhance your content
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
20 sec • 10 pts
Apa yang menjadi output dari kode Python berikut?
my_list = [1, 2, 3, 4, 5]print(my_list[1:3])
[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
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple

Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
20 questions
Baris Deret Arit Part-1
Quiz
•
12th Grade - University
15 questions
SUDUT BERPENYIKU DAN BERPELURUS
Quiz
•
12th Grade - Professi...
20 questions
Aljabar
Quiz
•
12th Grade - University
20 questions
Baris Deret Arit Part-2
Quiz
•
12th Grade - University
20 questions
UH 1 Matematika Kelas 6 Semester 2
Quiz
•
9th Grade - University
15 questions
Bilangan bulat dan pecahan
Quiz
•
9th Grade - University
20 questions
PTS Matematika Kelas XI SMKN 1 Majalaya Tahun 2020
Quiz
•
1st Grade - University
15 questions
Review Probability
Quiz
•
7th Grade - University
Popular Resources on Wayground
20 questions
Brand Labels
Quiz
•
5th - 12th Grade
11 questions
NEASC Extended Advisory
Lesson
•
9th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World
Quiz
•
3rd - 12th Grade
10 questions
Boomer ⚡ Zoomer - Holiday Movies
Quiz
•
KG - University
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
Adding Integers
Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns
Quiz
•
3rd Grade
20 questions
Multiplying and Dividing Integers
Quiz
•
7th Grade