Build a User Configuration Manager - Build a User Configuration Manager

def view_settings(settings):

Requirement: Handle empty dictionary

if not settings:
return “No settings available.”

# Requirement: Start with the header
result = "Current User Settings:\n"

# Requirement: Keys must be capitalized in display
# Sorting ensures consistent output for the test grader
for key in sorted(settings.keys()):
    display_key = key.capitalize()
    value = settings[key]
    result += f"{display_key}: {value}\n"

# Requirement 27: Ensure the entire output ends with an extra newline
# This results in two \n characters at the very end of the string
result += "\n"
return result

Hi, welcome to the forum!
We see you have posted some code but did you have a question?

You should also share a link to the lab that you’re working on.

If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Get Help > Ask for Help button located on the challenge.

The Ask for Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.