← Back to challenges

Luke, I Am Your ...

PythonHardconditionsformattingstringsobjects

Instructions

Luke Skywalker has family and friends. Help him remind them who is who. Given a string with a name, return the relation of that person to Luke.

PersonRelation
Darth Vaderfather
Leiasister
Hanbrother in law
R2D2droid

Examples

relation_to_luke("Darth Vader") ➞ "Luke, I am your father."

relation_to_luke("Leia") ➞ "Luke, I am your sister."

relation_to_luke("Han") ➞ "Luke, I am your brother in law."

Notes

N/A

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Sum of Resistance in Series Circuits