Build a User Configuration Manager - Build a User Configuration Manager

Tell us what’s happening:

Hi, so i found some similar problems but they did the part completely different from me. I didn’t wanna copy them. Anyways, 25-27 is just not working. Please help.

Failed:25. view_settings should return formatted settings for non-empty dictionary.
Failed:26. view_settings should capitalize the first letter of each setting name.
Failed:27. view_settings should display the correct results and end with a newline character.

Your code so far

def add_setting(add_dict, add_tuple):
    key, value = add_tuple

    clean_key = str(key).lower()
    clean_value = str(value).lower()

    add_dict.update(test_settings)

    if clean_key in add_dict:
        return (f"Setting '{clean_key}' already exists! Cannot add a new setting with this name.")
    #else
    add_dict[clean_key] = clean_value
    test_settings.update(add_dict)
    return(f"Setting '{clean_key}' added with value '{clean_value}' successfully!")

#==========================================================

def update_setting(updating_dict, updating_tuple):
    key, value = updating_tuple

    clean_key = str(key).lower()
    clean_value = str(value).lower()

    updating_dict.update(test_settings)

    if clean_key in updating_dict:
        updating_dict[clean_key] = clean_value
        test_settings.update(updating_dict)
        return(f"Setting '{clean_key}' updated to '{clean_value}' successfully!")
    #else
    return(f"Setting '{clean_key}' does not exist! Cannot update a non-existing setting.")

#===========================================================

def delete_setting(deleting_dict, deleting_key):
    key = deleting_key

    clean_key = str(key).lower()

    if clean_key in deleting_dict:
        del(deleting_dict[clean_key])
        return(f"Setting '{clean_key}' deleted successfully!")
    #else
    return("Setting not found!")

#============================================================

def view_settings(main_dict):
    if not main_dict:
        return("No settings available.")
    #else
    print("Current User Setting")
    for key, value in main_dict.items():
        clean_key = str(key).capitalize()
        clean_value = str(value).capitalize()
        print(f"{clean_key}: {clean_value}")

#===========================TEST=============================

(view_settings({'theme': 'dark', 'notifications': 'enabled', 'volume': 'high'}))

test_settings = {
'age' : '10',
'apps' : '15',
'functions' : 20}

Your browser information:

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

Challenge Information:

Build a User Configuration Manager - Build a User Configuration Manager

If the dictionary contains any settings, return a string displaying the settings

return a string, don’t print it

def view_settings(main_dict):

if not main_dict:

    return("No settings available.")

#else

output = "Current User Setting\\n"

for key, value in main_dict.items():

    clean_key = str(key).capitalize()

    clean_value = str(value).capitalize()

    output += (f"{clean_key}: {clean_value}\\n")

return output

I came up with this, but 25 and 27 still doesn’t work… do you know why

NEVERMIND, I GOT ITTTTTT !!! THANKS POOKIE!!! APPRECIATE THE HELP!!!