The format string that uses named field(s), is used with an argument that is not required by the format string. It is recommended to remove unused keyword-arguments for a better readability.
def greet_user(user):
print(
"Hi {name}!. Welcome to {location}.".format(
name=user.first_name, location=user.updated_loc, age=user.age
)
)
Here, the argument age
is nowhere used in the format string and should be removed.
def greet_user(user):
print(
"Hi {name}!. Welcome to {location}.".format(
name=user.first_name, location=user.updated_loc
)
)