Build a User Configuration Manager - Build a User Configuration Manager

Tell us what’s happening:

it does not recognise that my functions work. when it tested them myself they did work

Your code so far

test_settings = {
'theme': 'dark', 'notifications': 'enabled', 'volume': 'high'
}


def add_setting(dictionary,item):
    cey, value = item
    cey = cey.lower()
    value = value.lower()
    for key in dictionary.keys():
        if key == cey:
            print("Setting '"+ cey+"' already exists! Cannot add a new setting with this name.")
            return
    print("Setting "+ cey +" added with value "+value+" successfully!")
    dictionary.update({cey: value})

def update_setting(dictionary,item):
    cey, value = item
    cey = cey.lower()
    value = value.lower()
    for key in dictionary.keys():
        if key == cey:
            dictionary[key] = value
            print("Setting "+cey+" updated to "+value+ " successfully!")
            return
    print("Setting "+cey+" does not exist! Cannot update a non-existing setting.")
    
def delete_setting(dictionary,item):
    item = item.lower()
    for key in dictionary.keys():
        if key == item:
            dictionary.pop(item)
            print("Setting '"+item+"' deleted successfully!")
            return
    print("Setting not found!")

def view_settings(dictionary):
    if len(dictionary) == 0:
        print("No settings available.")
    else:
        print("Current User Settings:")
        for setting, waarde in dictionary.items():
            print(setting.capitalize(),":", waarde)

Your browser information:

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

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

You’re printing the message instead of returning it as a string, as required. Can you switch to returning the string?

Tell us what’s happening:

My code appears to be correct, and when I enter the commands specified in the assignment, the program produces the expected output. However, the program does not seem to recognize that the prompt is functioning correctly, even though the results match the assignment requirements.

Your code so far

test_settings = {
'theme': 'dark', 'notifications': 'enabled', 'volume': 'high'
}


def add_setting(dictionary,item):
    cey, value = item
    cey = cey.lower()
    value = value.lower()
    for key in dictionary.keys():
        if key == cey:
            print("Setting '"+ cey+"' already exists! Cannot add a new setting with this name.")
            return
    print("Setting "+ cey +" added with value "+value+" successfully!")
    dictionary.update({cey: value})

def update_setting(dictionary,item):
    cey, value = item
    cey = cey.lower()
    value = value.lower()
    for key in dictionary.keys():
        if key == cey:
            dictionary[key] = value
            print("Setting "+cey+" updated to "+value+ " successfully!")
            return
    print("Setting "+cey+" does not exist! Cannot update a non-existing setting.")
    
def delete_setting(dictionary,item):
    item = item.lower()
    for key in dictionary.keys():
        if key == item:
            dictionary.pop(item)
            print("Setting '"+item+"' deleted successfully!")
            return
    print("Setting not found!")

def view_settings(dictionary):
    if len(dictionary) == 0:
        print("No settings available.")
    else:
        print("Current User Settings:")
        for setting, waarde in dictionary.items():
            print(setting.capitalize(),":", waarde)

Your browser information:

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

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

I went ahead and combined your posts for you. In the future, just reply to the original thread to add further updates.

Welcome to the forum @mettendafteman,

Please carefully review the user stories about the messages you are displaying. Are you asked to print() them?

Don’t some of the messages ask you to enclose keys and/or values in single quotes?

Are you asked to print() the string in view_settings? And is that string formatted exactly as shown in the instructions? Carefully check spacing, please.

Happy coding

Thanks dude, this helped me complete it!