Build a User Configuration Manager - Build a User Configuration Manager

Tell us what’s happening:

Hi, currently just trying to check my work. However unable as the code raised an error. The error is not appearing. What could it be?

Your code so far

def add_setting(settings, new_setting):
    key, value = new_setting
    key = key.lower()
    value = value.lower
    if key in settings:
        return f"Setting '{key}' already exists! Cannot add a new setting with this name."
    else:
        settings.update({key:value})
        return "Setting '{key}' added with value '{value}' successfully!"

Your browser information:

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

Challenge Information:

Build a User Configuration Manager - Build a User Configuration Manager

1 Like

In the code snippet you shared you have no settings defined for it to test on. Work through some more of the user story and also make yourself some test settings to test your functions with.

print(settings(my_setting, my_new_setting))

I had this at the top of mine I used it to test setting with

Spoiler

test_settings = {‘mouse’: ‘large’,
‘theme’: ‘hdr’,
‘resolution’: ‘1920x1080’,
‘refresh’: ‘60Hz’,
}

Code:“”"

end of code"“”"

print(view_settings({‘theme’: ‘dark’, ‘notifications’: ‘enabled’, ‘volume’: ‘high’}))