def lumberjack(name, pronoun):
print("{}'s a lumberjack and {} OK!".format(name, pronoun))
lumberjack("Ashton", "he's")
lumberjack("Paris", "he's")
lumberjack("Sam", "they're")
How do I fix this little program? Right now, the name Paris will print to "Paris's" rather than "Paris'", which is obviously grammatically incorrect. How do I fix this? I assume I'd want to use an if statement, but I don't really know how to implement that into this little bit of code.
EDIT: I think I figured it out, but is there a more efficient way to do this certain thing than:
def lumberjack(name, pronoun):
if name[-1] == 's':
print("{}' a lumberjack and {} OK!".format(name, pronoun))
else:
print("{}'s a lumberjack and {} OK!".format(name, pronoun))
lumberjack("Ashton", "he's")
lumberjack("Paris", "he's")
lumberjack("Sam", "they're")