Logo
search
menuicon
ICT grade 11 Quiz

ICT grade 11 Quiz

ICT UNITY SCHO
숲 속
quiz thumbnail
Berurutan
SMA 11
TIK

ICT grade 11 Quiz

ICT UNITY SCHO

80

20 soal

Izinkan jawaban yang salah

Sembunyikan jawaban

public kuis

# 1Pilihan ganda
Which keyword is used in Python to start a conditional statement that checks if a condition is true?
else
elif
if
while
# 2Pilihan ganda
In Python, what does the 'else' statement do?
It executes a block of code if the 'if' condition is false.
It executes a block of code if the 'if' condition is true.
It checks for another condition.
It repeats a block of code multiple times.
# 3Pilihan ganda
What is the purpose of the 'elif' keyword in Python?
To start a loop.
To execute code if the previous 'if' or 'elif' was false and a new condition is true.
To end a program.
To define a function.
# 4Pilihan ganda
Which keyword is used to create a loop that continues as long as a condition is true?
if
for
while
break
# 5Pilihan ganda
What does the 'break' statement do inside a loop?
It continues to the next iteration of the loop.
It exits the loop immediately.
It starts a new loop.
It skips the rest of the current iteration.
# 6Pilihan ganda
Consider this code: `if 5 > 3: print('Hello')`. What will be printed?
Nothing
Hello
5
3
# 7Pilihan ganda
If an 'if' condition is false, and there is no 'else' or 'elif' block, what happens?
The program stops.
The code inside the 'if' block is skipped, and the program continues.
An error occurs.
The 'if' condition is checked again.
# 8Pilihan ganda
What is the output of the following code? `x = 10 if x < 5: print('A') else: print('B')`
A
B
Nothing
Error
# 9Pilihan ganda
Which of these is an example of a 'while' loop condition?
`for i in range(10):`
`if count == 0:`
`while score < 100:`
`else:`
# 10Pilihan ganda
If you have `if condition1: ... elif condition2: ... else: ...`, and `condition1` is true, which block will execute?
The `elif condition2` block
The `else` block
The `if condition1` block
None of the blocks
# 11Pilihan ganda
What is a common use case for the `break` statement?
To make a loop run forever.
To exit a loop when a specific item is found.
To start a new program.
To define variables.
# 12Pilihan ganda
Consider this code: `x = 0 while x < 3: print(x) x = x + 1`. What will be printed?
0 1 2
0 1 2 3
1 2 3
Nothing
# 13Pilihan ganda
Which of these is NOT a keyword used for control flow in Python?
if
while
print
else
# 14Pilihan ganda
What is the purpose of indentation in Python's `if`, `elif`, `else`, and `while` statements?
To add color to the code.
To define which lines of code belong to a specific block.
To make the code run faster.
To comment out lines.
# 15Pilihan ganda
If you want to check if a number `num` is positive, negative, or zero, which structure would be most appropriate?
A single 'if' statement.
A 'while' loop.
An 'if', 'elif', 'else' chain.
A 'break' statement.
# 16Pilihan ganda
What happens if a `while` loop's condition never becomes false?
The program prints an error.
The loop will eventually stop on its own.
It becomes an infinite loop, and the program may freeze.
The `break` statement is automatically executed.
# 17Pilihan ganda
Consider this code: `score = 75 if score >= 90: grade = 'A' elif score >= 80: grade = 'B' elif score >= 70: grade = 'C' else: grade = 'D'`. What will be the value of `grade`?
A
B
C
D
# 18Pilihan ganda
Which statement can be used to skip the rest of the current iteration of a loop and move to the next one?
break
continue
pass
return
# 19Pilihan ganda
What is the primary difference between `break` and `continue` in a loop?
`break` exits the loop entirely, `continue` skips to the next iteration.
`continue` exits the loop entirely, `break` skips to the next iteration.
`break` only works in `while` loops, `continue` only in `for` loops.
There is no difference.
# 20Pilihan ganda
If you have a `while True:` loop, how can you ensure it eventually stops?
It will stop automatically after a few seconds.
You must include a `break` statement with a condition inside the loop.
You can't stop it.
You need to add an `else` statement.
Bagikan ke Google Classroom

Akses dibatasi karena paket kedaluwarsa. Salin dan edit di map lain.