# Build a User Configuration Manager - Build a User Configuration Manager - Tests 4 & 5

**URL:** <https://forum.freecodecamp.org/t/build-a-user-configuration-manager-build-a-user-configuration-manager-tests-4-5/788653>\
**Category:** Curriculum Help\
**Tags:** python\
**Created:** [May 12, 2026, 4:54pm UTC](https://forum.freecodecamp.org/t/build-a-user-configuration-manager-build-a-user-configuration-manager-tests-4-5/788653 "2026-05-12T16:54:41Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![brunocunha3114](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/brunocunha3114/32/382086_2.png) [@brunocunha3114](https://forum.freecodecamp.org/u/brunocunha3114)\
**Post date:** [May 12, 2026, 4:54pm UTC](https://forum.freecodecamp.org/t/build-a-user-configuration-manager-build-a-user-configuration-manager-tests-4-5/788653/1 "2026-05-12T16:54:41Z")

</div>

### Tell us what’s happening:

The code is failing the tests 4 and 5, but the output is working properly.  
From the code I have seen on other related posts this should work. I’m not sure if I’m missing a importante detail or if it should be writen in another way.

Context:  
Test 4 - add\_setting should convert the key to lowercase.  
Test 5 - add\_setting should convert the value to lowercase.

Thanks in advance 🙂

### Your code so far

```py
test_settings ={'theme': 'light'}

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

def update_setting (dict_settings, update_setting):
    update_setting_key = str(update_setting[0]).lower()
    update_setting_val = str(update_setting[1]).lower()
    if update_setting_key in set(dict_settings.keys()):
        test_settings[update_setting_key] = update_setting_val
        return f"Setting '{update_setting_key}' updated to '{update_setting_val}' successfully!"
    else:
        return f"Setting '{update_setting_key}' does not exist! Cannot update a non-existing setting." 

def delete_setting (dict_settings, delete_setting_key):
    delete_setting_key = delete_setting_key.lower()
    if delete_setting_key in set(dict_settings.keys()):
        test_settings.pop(delete_setting_key)
        return f"Setting '{delete_setting_key}' deleted successfully!"
    else:
        return f"Setting not found!" 

def view_settings (dict_settings):
    if dict_settings == dict():
        return "No settings available."
    else:
        msg = f"Current User Settings:"
        for k in dict_settings:
            msg += f"\n{k.title()}: {dict_settings[k]}" 
        return msg

print(add_setting({'theme': 'light'}, ('THEME', 'dark')))
print(add_setting({'theme': 'light'}, ('volume', 'high')))
print(update_setting({'theme': 'light'}, ('theme', 'dark')))
print(update_setting({'theme': 'light'}, ('volume', 'high')))
print(delete_setting({'theme': 'light'}, 'theme'))
print(view_settings({'theme': 'dark', 'notifications': 'enabled', 'volume': 'high'}) )

```

### 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

> **[freeCodeCamp.org](https://www.freecodecamp.org/learn/python-v9/lab-user-configuration-manager/build-a-user-configuration-manager)**
>
> Learn to Code — For Free

Github Link: [https://github.com/freeCodeCamp/freeCodeCamp/blob/main/curriculum/challenges/english/blocks/lab-user-configuration-manager/684aaf9ec670c68d20efd0d0.md](https://github.com/freeCodeCamp/freeCodeCamp/blob/main/curriculum/challenges/english/blocks/lab-user-configuration-manager/684aaf9ec670c68d20efd0d0.md)

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [May 12, 2026, 5:01pm UTC](https://forum.freecodecamp.org/t/build-a-user-configuration-manager-build-a-user-configuration-manager-tests-4-5/788653/2 "2026-05-12T17:01:25Z")

</div>

check the parameters of `add_settings` function

---

<div class="post-metadata">

**Author:** ![brunocunha3114](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/brunocunha3114/32/382086_2.png) [@brunocunha3114](https://forum.freecodecamp.org/u/brunocunha3114)\
**Post date:** [May 12, 2026, 5:07pm UTC](https://forum.freecodecamp.org/t/build-a-user-configuration-manager-build-a-user-configuration-manager-tests-4-5/788653/3 "2026-05-12T17:07:53Z")

</div>

I checked with the print() and isinstance() functions and it seems right the new\_setting\_key and new\_setting\_val are strings in lower case

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [May 12, 2026, 5:09pm UTC](https://forum.freecodecamp.org/t/build-a-user-configuration-manager-build-a-user-configuration-manager-tests-4-5/788653/4 "2026-05-12T17:09:21Z")

</div>

not I was hinting at… what are the two parameters called?

> [@brunocunha3114](#):
>
> ` test_settings[new_setting_key] = new_setting_val`

---

<div class="post-metadata">

**Author:** ![brunocunha3114](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/brunocunha3114/32/382086_2.png) [@brunocunha3114](https://forum.freecodecamp.org/u/brunocunha3114)\
**Post date:** [May 12, 2026, 5:22pm UTC](https://forum.freecodecamp.org/t/build-a-user-configuration-manager-build-a-user-configuration-manager-tests-4-5/788653/5 "2026-05-12T17:22:25Z")

</div>

The tests are solved, thanks, but I have a question

My tought while wrinting the code was that every operation it would be made on the test\_settings not in the parameter input of each funtion. Because in my mind the input would be a temporary variable and if I change it when I returned from the function the modification it whould be losted.

Why does it save the change if I don’t return it?

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [May 12, 2026, 5:37pm UTC](https://forum.freecodecamp.org/t/build-a-user-configuration-manager-build-a-user-configuration-manager-tests-4-5/788653/6 "2026-05-12T17:37:13Z")

</div>

the parameter is a variable that exists only in the function that is true, but when you call the function, you pass in a _reference_ to a dictionary, not a copy

it is important you always use the parameters so that a function is reusable with different objects

about the reference, consider this:

```py
dict_a = {"greeting": "hello", "name": "John"}

dict_b = dict_a

dict_b["greeting"] = "hi"

print(f'{dict_a["greeting"]}, {dict_a["name"]}')

```

what do you expect is printed here? make a prediction, then test the code

---

<div class="post-metadata">

**Author:** ![brunocunha3114](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/brunocunha3114/32/382086_2.png) [@brunocunha3114](https://forum.freecodecamp.org/u/brunocunha3114)\
**Post date:** [May 12, 2026, 6:04pm UTC](https://forum.freecodecamp.org/t/build-a-user-configuration-manager-build-a-user-configuration-manager-tests-4-5/788653/7 "2026-05-12T18:04:47Z")

</div>

I was expecting the “hello Jonh” but the test showed “hi John”. I got it, now makes sense.  
But if the “=” sign create a reference how do you create a copy? With tuples?

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [May 12, 2026, 6:08pm UTC](https://forum.freecodecamp.org/t/build-a-user-configuration-manager-build-a-user-configuration-manager-tests-4-5/788653/8 "2026-05-12T18:08:50Z")

</div>

no, if you put an object in a tuple, it is still an object. you need to create a copy proper. For example with the `copy()` method: `dict_b = dict_a.copy()`

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [June 9, 2026, 6:08pm UTC](https://forum.freecodecamp.org/t/build-a-user-configuration-manager-build-a-user-configuration-manager-tests-4-5/788653/9 "2026-06-09T18:08:58Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
