
PE1_module 4_test
Authored by Ngoc Phan
Education
University
Used 5+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Đáp án nào định nghĩa đúng hàm fun có hai tham số, có giá trị ban đầu đều là 0?
def fun (a=b=0) :
def fun (a=0, b=0) :
fun fun (a=0, b) :
fun fun (a, b=0) :
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Kết quả của đoạn mã sau là gì?
def fun(x):
... if x % 2 == 0:
... ... return 1
... else:
... ... return 0
print(fun(fun(2)) + 1)
1
None
the code will cause a runtime error
2
1
2
None
sẽ báo lỗi khi chạy lệnh
3.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Phát biểu nào đúng? (Chọn 2 đáp án)
Giá trị None có thể được gán cho biến
Giá trị None không được sử dụng bên ngoài hàm
GIá trị None có thể được sử dụng như là một tham số của các toán tử số học
Giá trị None có thể được so sánh với các biến
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Đoạn mã sau sẽ xuất ra giá trị nào?
def func_1(a):
return a ** a
def func_2(a):
return func_1(a) * func_1(a)
print(func_2(2))
2
4
16
báo có lỗi
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Chèn dòng mã lệnh nào dưới đây vào chỗ "#chèn câu lệnh của bạn" để có kết quả xuất ra là:
a
b
c
dictionary = {}
my_list = ['a', 'b', 'c', 'd']
for i in range(len(my_list) - 1):
dictionary[my_list[i]] = (my_list[i], )
for i in sorted(dictionary.key()):
k = dictionary[i]
# Insert your code here.
print(k["0"])
print(k)
print(k[0])
print(k['0'])
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Đoạn mã sau:
def func(a, b):
... return a ** b
print(func(2,2))
báo lỗi
sẽ xuất ra 2
sẽ xuất ra 4
sẽ trở lại None
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
def fun(inp=2, out=3):
... return inp * out
print(fn(inp =3))
9
4
6
8
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
20 questions
UNIT 2 URBANIZATION
Quiz
•
12th Grade - University
15 questions
Communication and Technology
Quiz
•
University
15 questions
Kiểm tra bài cũ
Quiz
•
University
15 questions
Manners, Etiquettes and Dress code
Quiz
•
University
15 questions
Nguyên lý thống kê kinh tế chương 2
Quiz
•
University
20 questions
Psych 356 Midterm Practice
Quiz
•
9th Grade - University
20 questions
BÀI KIỂM TRA GIỮA HỌC PHẦN I - UDCK
Quiz
•
University
15 questions
TÌM HIỂU KIẾN THỨC 80 NĂM THÀNH LẬP QĐND VIỆT NAM
Quiz
•
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
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade