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
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
Similar Resources on Wayground
15 questions
Multiplying Two Digit by Three Digit

Quiz
•
5th Grade - University
20 questions
Factors vs Multiples Sort

Quiz
•
4th Grade - University
19 questions
Number Word Equations

Quiz
•
7th Grade - University
15 questions
Identifying Coins

Quiz
•
2nd Grade - University
20 questions
Solving Linear Equations With No Multiple Choices

Quiz
•
8th Grade - University
15 questions
Operations With Integers Practice

Quiz
•
8th Grade - University
20 questions
Rational Root Theorem Possible Roots

Quiz
•
11th Grade - University
15 questions
Dividing Practice

Quiz
•
6th Grade - University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade