Represent the Student
You are tasked with writing a Python function,
student_details()
, that accepts and records details about a student. The details to be accepted include name, age, grade, and subjects, among others.The
student_details()
function should accept a positional-only argument for the student's name, and a variable number of keyword-only arguments for all the other details.The function should return a dictionary where the keys are the names of the details and the values are the corresponding details.
Input | Output |
student_details('John Doe', age=14, grade=9, subjects=['Math', 'English', 'Science']) | {'name': 'John Doe', 'age': 14, 'grade': 9, 'subjects': ['Math', 'English', 'Science']} |
Note: The keys in the output dictionary should be in the order of appearance in the input.
Constraints
Time limit: 2 seconds
Memory limit: 512 MB
Output limit: 1 MB