Search Header Logo

Basic Programming 2

Authored by Ulfah Khairiyah Luthfiyani

Business

1st - 10th Grade

Used 1+ times

Basic Programming 2
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

my_dict = {"apple": 3, "banana": 5, "orange": 2}
count = 0
for fruit, quantity in my_dict.items():
count += quantity
print(count)

Berapakah nilai count ?

3

5

10

Error

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

num = 10
while num > 0:
num -= 3

Berapakah kali iterasi yang dilakukan untuk mencapai syarat num diatas?

2

3

4

5

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

num = 7
if num % 2 == 0:
print("Even")
else:
print("Odd")

Apa hasil code diatas ?

Odd

Even

7

Error

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

num_list = [2, 3, 4, 5, 6]
total = 0
for num in num_list:
if num % 2 == 0:
total += num
print(total)

Nilai dari total adalah ......

4

6

10

12

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

my_dict = {"apple": 3, "banana": 5, "orange": 2}
fruit = "grape"
if fruit not in my_dict:
print("No")
else:
print("Yes")

Jawaban dari code diatas adalah ......

No

Yes

True

False

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

num_list = [1, 2, 3, 4, 5]
total = 0
for num in num_list:
if num == 3:
break
total += num
print(total)

Berapa nilai dari total setelah eksekusi kode diatas?

3

5

6

7

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Apa itu dictionary dalam Python dan bagaimana cara membuatnya?

Sebuah struktur data untuk menyimpan elemen-elemen dalam urutan tertentu.

Sebuah struktur data yang hanya dapat menyimpan tipe data numerik.

Sebuah fungsi bawaan dalam Python untuk mengurutkan data.

Sebuah struktur data yang berisi pasangan kunci-nilai.

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?