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
25 questions
ADP KUIS 4

Quiz
•
University
15 questions
Hiburan

Quiz
•
KG - University
20 questions
Solusi Proyek Kucing

Quiz
•
4th Grade - University
20 questions
PYTHON-MCQ

Quiz
•
University
20 questions
Phyton for Data Analysis

Quiz
•
University
15 questions
TKJ

Quiz
•
12th Grade - University
15 questions
Python

Quiz
•
University
15 questions
Soal Pilihan Ganda Wilkerstat SE2026

Quiz
•
University
Popular Resources on Wayground
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade