Build a User Configuration Manager - Build a User Configuration Manager

Tell us what’s happening:

I’m a bit confused with step 25-27 in general and what it means by “formatted settings” I assume it just doesn’t wants like raw data and something that’s a bit more formal but I tried this in my code with the commented out print command for view settings but the test wouldn’t pass please help. Ive tried a few other ways besides this one btw

Your code so far

test_settings = {
    'language': 'English',
    'processor': 'Windows',
    'layout': 'QWERTY'
}

def add_setting(settings, setting):
    key, value = 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."
    if key not in settings:
        settings[key] = value
        return f"Setting '{key}' added with value '{value}' successfully!"
    
 


def update_setting(settings, values):
    key, value = values
    key = key.lower()
    value = value.lower()
    if key in settings:
        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."


def delete_setting(settings, setting):
    setting = setting.lower()
    if setting in settings:
        del settings[setting]
        return f"Setting '{setting}' deleted successfully!"
    if setting not in settings:
        return "Setting not found!"

def view_settings(settings):
    if not settings:
        return "No settings available."

    result = ""
    for key, value in settings.items():
        key = key.capitalize()
        result += f"Setting: {key}, Value: {value}\n"

    return result.strip()

# 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/151.0.0.0 Safari/537.36 Edg/151.0.0.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 @raima1,

Please review again the second bullet point in User Story #8:

  • If the dictionary contains any settings, return a string displaying the settings. The string should start with Current User Settings: followed by the key-value pairs, each on a new line and with the key capitalized. For example, view_settings({'theme': 'dark', 'notifications': 'enabled', 'volume': 'high'}) should return:
Current User Settings:
Theme: dark
Notifications: enabled
Volume: high

Is that what view_settings is returning?

Happy coding

Your right thank you so much