
TA MODUL 2 (VERSI 3)
Authored by Ibes Ibes
Other
University
Used 4+ times

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
Perhatikan kode berikut
Operator manakah yang tepat untuk mengisi bagian yang kosong agar menghasilkan output "1 2 3 4"?
=
+=
*=
/=
Answer explanation
Operator += menambahkan nilai 1 ke variabel i pada setiap iterasi.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Apa output dari kode berikut?
3 4 5 6 7
3 5 7
4 6 8
3 6
Answer explanation
range(3, 8, 2) menghasilkan deret dengan start=3, stop=8 (eksklusif), dan step=2.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Perhatikan kode berikut
Apakah output yang dihasilkan?
5
10
15
Error
Answer explanation
Fungsi outer membuat closure dengan nilai x=10, kemudian inner menambahkan y=5.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Lengkapi kode berikut untuk membuat fungsi yang valid
func
void
def
function
Answer explanation
'def' adalah keyword untuk mendefinisikan fungsi dalam Python.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Perhatikan kode berikut:
i = 0
while True:
if i >= 5:
break
print(i, end=' ')
i += 1
Apakah output yang dihasilkan?
0 1 2 3 4 5
0 1 2 3 4
1 2 3 4 5
Infinite loop
Answer explanation
Loop berhenti ketika i mencapai 5, setelah mencetak 0 sampai 4.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Manakah syntax yang benar untuk membuat fungsi dengan parameter *args?
def func(*args)
def func(**args)
def func(args*)
def func(*arg)
Answer explanation
*args adalah sintaks yang benar untuk parameter variadic.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Apa output dari kode berikut?
def outer():
x = 1
def inner():
nonlocal x
x = 2 i
nner()
return x
print(outer())
1
2
None
Error
Answer explanation
Keyword nonlocal memungkinkan inner function mengubah variabel outer function.
Access all questions and much more by creating a free account
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
Already have an account?
Similar Resources on Wayground
10 questions
AMC QUIZ 1
Quiz
•
University
15 questions
Tax Goes to School
Quiz
•
University
10 questions
ICE Task 1
Quiz
•
University
10 questions
Catalyst Characterization: Chemical Techniques
Quiz
•
University
14 questions
Business Finance (2)
Quiz
•
University
10 questions
Partnership Quiz
Quiz
•
University
12 questions
Conditional Statements : Quiz - 4
Quiz
•
University
9 questions
Bài test thi đố em Khối 12
Quiz
•
12th Grade - University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
29 questions
Alg. 1 Section 5.1 Coordinate Plane
Quiz
•
9th Grade
22 questions
fractions
Quiz
•
3rd Grade
11 questions
FOREST Effective communication
Lesson
•
KG
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
Discover more resources for Other
12 questions
IREAD Week 4 - Review
Quiz
•
3rd Grade - University
7 questions
Fragments, Run-ons, and Complete Sentences
Interactive video
•
4th Grade - University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
10 questions
DNA Structure and Replication: Crash Course Biology
Interactive video
•
11th Grade - University
5 questions
Inherited and Acquired Traits of Animals
Interactive video
•
4th Grade - University
5 questions
Examining Theme
Interactive video
•
4th Grade - University
20 questions
Implicit vs. Explicit
Quiz
•
6th Grade - University
7 questions
Comparing Fractions
Interactive video
•
1st Grade - University