Undefined format string keyPYL-E1304
This format string with named placeholders is being used with a dictionary that doesn't contain all the keys required by the format string. This is an error. Please revisit the statement and add the necessary keys or remove them from the format string.
Not Preferred:
def greet_user(user):
print(
"Hi %(name)s!. Welcome to %(location)s."
% {"name": user.first_name, "age": user.age}
)
Preferred:
def greet_user(user):
print(
"Hi %(name)s!. Welcome to %(location)s."
% {"name": user.first_name, "location": user.updated_loc}
)