Build a User Configuration Manager - Build a User Configuration Manager

Tell us what’s happening:

In the console I got for the first 15 story points the following message: “Your code raised an error before any tests could run. Please fix it and try again.” In the 18th story point it starts with the regular message from story point 18.
In the same time I don’t get any message from the terminal, except I have an syntax error. In this sense, the code looks correct (there are obviously mistakes in it). But in the first step, it’s not about the code but about the message in the console.
Is this a glitch or something? Thank you in advance!

Your code so far

view_settings = [
    {
    'theme': 'dark', 
    'notifications': 'enabled', 
    'volume': 'high'
    }
]

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

def update_setting(settings, pair):
    pair = key, value
    value = settings[key]
    settings[key.lower()] = value.lower()
    if settings.key(setting) in settings:
        return f"Setting '{key}' updated to '{value}' successfully!"
    if not settings.key(setting) in settings:
        return f"Setting '{key}' does not exist! Cannot update a non-existing setting."
    
def delete_setting(settings, key):
    settings[key.lower()]
    if settings.key(setting) in settings:
        settings.remove(key)
        return f"Setting '{key}' deleted successfully!"
    
def view_settings(settings):
    if settings == {}:
        return "No settings available."
    if settings != {}:
        return f"Current User Settings: 'key.upper() = settings[key]'"


Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0

Challenge Information:

Build a User Configuration Manager - Build a User Configuration Manager

Github Link: freeCodeCamp/curriculum/challenges/english/blocks/lab-user-configuration-manager/684aaf9ec670c68d20efd0d0.md at main · freeCodeCamp/freeCodeCamp · GitHub

Hi @patrick.weissler,

How are you testing your own code before running the tests? I don’t see any function calls.

Try looking at the tests and doing the function calls there to see if your code returns what the test expects.

Then you should see a NameError in the console. Go to the last line number shown in the error message and fix the code there before moving on.

Happy coding!

Thank you for your quick response, as always!

If the problem is me, I think I’m not suited for coding (or for this kind of course) hahaha

Did you try the function call in Test #6?

When you do that, you should see the error message in the console that will help you troubleshoot your code.

We all face issues with our code, but that doesn’t mean we’re not suited for coding. Just keep at it!

And ask all the questions you want…we’re here to try to help!