Home »
MCQs »
Python MCQs
Can we pass List as an argument in Python function?
57. Can we pass List as an argument in Python function?
- Yes
- No
Answer: A) Yes
Explanation:
In a function, we can pass any data type as an argument, such as a string or a number or a list or a dictionary, and it will be treated as if it were of that data type inside the function. The following code exemplifies this –
def St_list(student):
for x in student:
print(x)
students = ["Anil", "Rex", "Jerry"]
St_list(students)
"""
Output:
Anil
Rex
Jerry
"""