Bài kiểm tra chức năng Python này cung cấp nhiều câu hỏi [MCQ] để làm quen với cách tạo chức năng, các hàm lồng nhau và sử dụng các đối số chức năng một cách hiệu quả. 1. Đầu ra của cuộc gọi chức năng sau là gìWhat is the output of the following function calldef fun1[name, age=20]:
print[name, age]
fun1['Emma', 25]
2. Đầu ra của cuộc gọi chức năng display[]
sau đây là gìWhat is the output of the
following display[]
function call
def display[**kwargs]:
for i in kwargs:
print[i]
display[emp="Kelly", salary=9000]
TypeErrorTypeError
& nbsp; Kelly 9000Kelly
9000
& nbsp;[’emp’, ‘Kelly’]
[‘salary’, 9000]
& nbsp; Mức lương của empemp
salary
3. Chọn loại nào đúng với hàm PythonSelect which is true for Python function
& nbsp; hàm python chỉ có thể trả về một giá trị duy nhấtA Python function can return only a single value
& nbsp; một hàm có thể có một số lượng đối số không giới hạn.A function can take an unlimited number of arguments.
& nbsp; hàm python có thể trả về nhiều giá trịA Python function can return multiple values
& nbsp; hàm python không trả lại bất cứ điều gì trừ khi bạn thêm câu lệnh trả vềPython function doesn’t return anything unless and until you add a return statement
4. Đầu ra của mã sau là gì?What is the output of the following code?
def outer_fun[a, b]:
def inner_fun[c, d]:
return c + d
return inner_fun[a, b]
res = outer_fun[5, 10]
print[res]
5. Đầu ra của cuộc gọi chức năng
0 là gìWhat is the output of the def display[**kwargs]:
for i in kwargs:
print[i]
display[emp="Kelly", salary=9000]
def display[**kwargs]:
for i in kwargs:
print[i]
display[emp="Kelly", salary=9000]
0 function calldef add[a, b]:
return a+5, b+5
result = add[3, 2]
print[result]
6. Đầu ra của cuộc gọi chức năng sau là gìWhat is the output of the following function call
def outer_fun[a, b]:
def inner_fun[c, d]:
return c + d
return inner_fun[a, b]
return a
result = outer_fun[5, 10]
print[result]
55
1515
& nbsp; [15, 5][15, 5]
& nbsp; lỗi cú phápSyntax Error
7. Đầu ra của cuộc gọi chức năng
1 sau đây là gìWhat is the output of the following def display[**kwargs]:
for i in kwargs:
print[i]
display[emp="Kelly", salary=9000]
def display[**kwargs]:
for i in kwargs:
print[i]
display[emp="Kelly", salary=9000]
1 function calldef display_person[*args]:
for i in args:
print[i]
display_person[name="Emma", age="25"]
TypeErrorTypeError
& nbsp; Emma 25Emma
25
& nbsp; tên tuổiname
age
8. Chọn khai báo chức năng chính xác của & nbsp;
2 để chúng tôi có thể thực hiện cuộc gọi chức năng sauChoose the correct function declaration of def display[**kwargs]:
for i in kwargs:
print[i]
display[emp="Kelly", salary=9000]
def display[**kwargs]:
for i in kwargs:
print[i]
display[emp="Kelly", salary=9000]
2 so that we can execute the following function call successfullyfun1[25, 75, 55]
fun1[10, 20]
def display[**kwargs]:
for i in kwargs:
print[i]
display[emp="Kelly", salary=9000]
3def display[**kwargs]:
for i in kwargs:
print[i]
display[emp="Kelly", salary=9000]
3& nbsp; không, không thể ở PythonNo, it is not possible in Python
def display[**kwargs]:
for i in kwargs:
print[i]
display[emp="Kelly", salary=9000]
4def display[**kwargs]:
for i in kwargs:
print[i]
display[emp="Kelly", salary=9000]
4
def display[**kwargs]:
for i in kwargs:
print[i]
display[emp="Kelly", salary=9000]
5def display[**kwargs]:
for i in kwargs:
print[i]
display[emp="Kelly", salary=9000]
59. Hàm Python luôn trả về giá trịPython function always returns a value
10. Đưa ra chức năng sau
2 Vui lòng chọn tất cả các cuộc gọi chức năng chính xácGiven the following function def display[**kwargs]:
for i in kwargs:
print[i]
display[emp="Kelly", salary=9000]
def display[**kwargs]:
for i in kwargs:
print[i]
display[emp="Kelly", salary=9000]
2 Please select all the correct function callsdef fun1[name, age]:
print[name, age]
7def display[**kwargs]: for i in kwargs: print[i] display[emp="Kelly", salary=9000]
8def display[**kwargs]: for i in kwargs: print[i] display[emp="Kelly", salary=9000]
def display[**kwargs]:
for i in kwargs:
print[i]
display[emp="Kelly", salary=9000]
9def display[**kwargs]:
for i in kwargs:
print[i]
display[emp="Kelly", salary=9000]
9
def outer_fun[a, b]:
def inner_fun[c, d]:
return c + d
return inner_fun[a, b]
res = outer_fun[5, 10]
print[res]
0def outer_fun[a, b]:
def inner_fun[c, d]:
return c + d
return inner_fun[a, b]
res = outer_fun[5, 10]
print[res]
011. Đầu ra của cuộc gọi chức năng sau là gìWhat is the output of the following function call
def fun1[num]:
return num + 25
fun1[5]
print[num]
12. Chọn đúng cho chức năng PythonSelect which true for Python function
& nbsp; một hàm là một khối mã chỉ thực thi khi được gọi và luôn trả về một giá trị.A function is a code block that only executes when called and always returns a value.
& nbsp; một chức năng chỉ thực thi khi nó được gọi và chúng ta có thể sử dụng lại nó trong một chương trìnhA function only executes when it is called and we can reuse it in a program
& nbsp; python không hỗ trợ chức năng lồng nhauPython doesn’t support nested function
Bài tập và câu đố Python
Các bài tập mã hóa miễn phí và các câu đố bao gồm các vấn đề cơ bản của Python, cấu trúc dữ liệu, phân tích dữ liệu, v.v.
- Hơn 15 bài tập và câu đố dành riêng cho chủ đềTopic-specific Exercises and Quizzes
- Mỗi bài tập chứa 10 câu hỏi
- Mỗi bài kiểm tra chứa 12-15 mcq
Question:
Richard H.
Hình học
10 & nbsp; tháng, 4 & nbsp; tuần trước
Trả lời video:
Nhận câu trả lời cho vấn đề bài tập về nhà của bạn.
Hãy thử Numerade miễn phí trong 7 ngày
Chúng tôi không có câu hỏi được yêu cầu của bạn, nhưng đây là một video được đề xuất có thể giúp ích.
Câu hỏi liên quan
Đúng là loại biến nào? một. Phao b. chuỗi c. Số nguyên d. Boolean Python 3
Thảo luận
Bạn phải được đăng nhập để thảo luận.
Bảng điểm video
Tôi muốn nói xin chào với sinh viên. Một câu hỏi thông qua ISO True là loại dữ liệu và Python. Không sao đâu. Chúng tôi có thể lựa chọn giữa giáo viên và thỏi. Chúng tôi phải biết rằng đó là một câu hỏi dựa trên thực tế. Loại sự thật của loại dữ liệu thực sự được gọi là kiểu dữ liệu boolean. Loại dữ liệu chúng ta có thể viết là đúng. Loại dữ liệu là đúng. Nó có nghĩa là những gì chúng ta có thể nói về tùy chọn nào là tùy chọn trực tiếp D. Đó là một tùy chọn chính xác B. Đây sẽ là câu trả lời cuối cùng cho câu hỏi này. Cảm ơn bạn đã dành thời gian trả lời.
Numerade có các giải pháp video từng bước, phù hợp trực tiếp với hơn +2.000 sách giáo khoa.
Các nhà giáo dục hình học hàng đầu