Build a User Configuration Manager - Build a User Configuration Manager

Tell us what’s happening:

hello all
i tried with this exam but every time gave me the step 27 is not okay
(view_settings should display the correct results and end with a newline character.)
on the other hand, its shown on console that what is need exactly
i dont know where i should look

Your code so far

test_settings = {
    'Theme': 'dark',
    'Notifications': 'enabled',
    'Volume': 'high',
}
#step from 1-8
def add_setting(dictionary_settings, key_value):
    key = str(key_value[0]).lower()
    value = str(key_value[1]).lower()

    if key in dictionary_settings:
        return f"Setting '{key}' already exists! Cannot add a new setting with this name."
    else:
        dictionary_settings[key] = value
        return f"Setting '{key}' added with value '{value}' successfully!"

#step from 9-15
def update_setting(dictionary_settings, keys_values):
    key =str (keys_values[0]).lower()
    value = str (keys_values[1]).lower()

    if key in dictionary_settings:
        dictionary_settings[key] = value
        return (f"Setting '{key}' updated to '{value}' successfully!")
    else:
        return (f"Setting '{key}' does not exist! Cannot update a non-existing setting.")

#step from 16-21
def delete_setting(dictionary_settings, key):
    key = key.lower()

    if key in dictionary_settings:
        dictionary_settings.pop(key)
        return (f"Setting '{key}' deleted successfully!")
    else:
        return (f"Setting not found!") 

#step from 22-27
def view_settings(settings_dict):
    if not settings_dict:
        return (f"No settings available.")
    
    formatted_settings = "Current User Settings:"
    for key, value in settings_dict.items():
        formatted_settings += f"\n{key.capitalize()}: {value}"
    return formatted_settings

print(view_settings(test_settings))

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36

Challenge Information:

Build a User Configuration Manager - Build a User Configuration Manager

Hi there,

You can test like this to see the newline characters:
print(repr(view_settings(test_settings)))

Happy coding!

“““

‘Current User Settings:\nTheme: dark\nNotifications: enabled\nVolume: high’

“““

still step 27
its shows like this on console without space and its not on new line

Does your code end with a newline character?

i put it in begin ,thank you bro