Build a User Configuration Manager - Build a User Configuration Manager

Tell us what’s happening:

why i cant convert the key and the value to lowercase can some one help me

Your code so far

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

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


Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.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

Hi @hassan12,

Consider the first user story:

You should define a function named add_setting with two parameters representing a dictionary of settings and a tuple containing a key-value pair

When you call the function, does key represent a dictionary? Does value represent a tuple?

Happy coding!

If what you want to extract is the key and the value, you need to read the first and second elements of the tuple, pass it to string and then to lowercase.

May the force be with you…