×

Multiple-Choice Questions

Web Technologies MCQs

Computer Science Subjects MCQs

Databases MCQs

Programming MCQs

Testing Software MCQs

Digital Marketing Subjects MCQs

Cloud Computing Softwares MCQs

AI/ML Subjects MCQs

Engineering Subjects MCQs

Office Related Programs MCQs

Management MCQs

More

Can we pass List as an argument in Python function?

57. Can we pass List as an argument in Python function?

  1. Yes
  2. 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
"""

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.