我是 python 新手,目前正在当地大学就读初级 python 课程。这是我获得 ICS 学位的要求。昨天我做了一个测验,问题是“以下什么是参数。我知道 def register_for_class(studen_id, crn): 是参数,我知道函数调用是参数,但其他任何东西都被视为参数吗?我的老师不会告诉我。她只是说,不仅仅是函数调用作为参数。
def register_for_class(student_id, crn): # parameter
add_class(student_id, crn, 2022, 'Spring')
student_name = get_name(student_id)
class_name = get_class(crn)
msg = student_name + ' is now enrolled in: ' + class_name
return msg
register_for_class(19283746, 22319) # function call
Run Code Online (Sandbox Code Playgroud)