Change both name and age
Input
modify_person("Alice", 30, "Alicia", 31)
Output
('Alicia', 31)
A Person is created with ('Alice', 30). Both attributes are updated and the new tuple is returned.
Full lesson preview
Learn to change attributes on an object instance after it's created.
Problem statement
Task
Examples
Input
modify_person("Alice", 30, "Alicia", 31)
Output
('Alicia', 31)
A Person is created with ('Alice', 30). Both attributes are updated and the new tuple is returned.
Input format
Output format
Constraints
Samples
Input
modify_person("Bob", 20, None, 21)
Output
('Bob', 21)
Only the age is updated because new_name is None.