Build a User Configuration Manager - Build a

Tell us what’s happening:

I am having issues with challenges 4, 5, 7, 8, 18, 19, 21, 25, 26, and 27. I need help with the functionality of some of my functions , the lowercase feature, and printing the output. Thank you.

Your code so far

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

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

def update_setting(dict_set, key_val):
    key = key_val[0].lower()
    value = key_val[1].lower()

    if key in dict_set:
        dict_set[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(dict_set, key_val):
    key = key_val[0].lower()
    value = key_val[1].lower()
    if key in dict_set:
        dict_set.pop()
        return f"Setting '{key}' deleted successfully!"
    else:
        return 'Setting not found!'
    
def view_settings(dict_set):
    if not dict_set:
        return 'No settings available.'
    else:
        return "Current User Settings:\n" + test_settings


        
    



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

Here are some troubleshooting steps you can follow. Focus on one test at a time:

  1. Are there any errors or messages in the console?
  2. What is the requirement of the first failing test?
  3. Check the related User Story and ensure it’s followed precisely.
  4. What line of code implements this?
  5. What is the result of the code and does it match the requirement?

If this does not help you solve the problem, please reply with answers to these questions.

where have you actually added the new key/value?

are you using this method correctly? don’t you need to pass it an argument? are you seeing an error in the console when you test this function?

will this give the output asked for in user story #8? =>

The string should start with Current User Settings: followed by the key-value pairs, each on a new line and with the key capitalized.

I fixed these thank you now its just 25-27

Ok, test 25:

  1. Are there any errors or messages in the console?
  2. What is the requirement of the test?
  3. Check the related User Story and ensure it’s followed precisely.
  4. What line of code implements this?
  5. What is the result of the code and does it match the requirement? (Write the value of a variable to the console at that point in the code if needed.)

If this does not help you solve the problem, please reply with answers to these questions.

Please do not open duplicate topics.

Just share your updated code in a comment here, like this:

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

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


def update_setting(dict_set, key_val):
    key = key_val[0].lower()
    value = key_val[1].lower()

    if key in dict_set:
        dict_set[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(dict_set, key_val):
    key = key_val.lower()
    if key in dict_set:
        dict_set.pop(key)
        return f"Setting '{key}' deleted successfully!"
    else:
        return 'Setting not found!'
    
def view_settings(dict_set):
    if not dict_set:
        return 'No settings available.'
    else:
        return "Current User Settings:\n" + test_settings