it does not recognise that my functions work. when it tested them myself they did work
Your code so far
test_settings = {
'theme': 'dark', 'notifications': 'enabled', 'volume': 'high'
}
def add_setting(dictionary,item):
cey, value = item
cey = cey.lower()
value = value.lower()
for key in dictionary.keys():
if key == cey:
print("Setting '"+ cey+"' already exists! Cannot add a new setting with this name.")
return
print("Setting "+ cey +" added with value "+value+" successfully!")
dictionary.update({cey: value})
def update_setting(dictionary,item):
cey, value = item
cey = cey.lower()
value = value.lower()
for key in dictionary.keys():
if key == cey:
dictionary[key] = value
print("Setting "+cey+" updated to "+value+ " successfully!")
return
print("Setting "+cey+" does not exist! Cannot update a non-existing setting.")
def delete_setting(dictionary,item):
item = item.lower()
for key in dictionary.keys():
if key == item:
dictionary.pop(item)
print("Setting '"+item+"' deleted successfully!")
return
print("Setting not found!")
def view_settings(dictionary):
if len(dictionary) == 0:
print("No settings available.")
else:
print("Current User Settings:")
for setting, waarde in dictionary.items():
print(setting.capitalize(),":", waarde)
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36
Challenge Information:
Build a User Configuration Manager - Build a User Configuration Manager
My code appears to be correct, and when I enter the commands specified in the assignment, the program produces the expected output. However, the program does not seem to recognize that the prompt is functioning correctly, even though the results match the assignment requirements.
Your code so far
test_settings = {
'theme': 'dark', 'notifications': 'enabled', 'volume': 'high'
}
def add_setting(dictionary,item):
cey, value = item
cey = cey.lower()
value = value.lower()
for key in dictionary.keys():
if key == cey:
print("Setting '"+ cey+"' already exists! Cannot add a new setting with this name.")
return
print("Setting "+ cey +" added with value "+value+" successfully!")
dictionary.update({cey: value})
def update_setting(dictionary,item):
cey, value = item
cey = cey.lower()
value = value.lower()
for key in dictionary.keys():
if key == cey:
dictionary[key] = value
print("Setting "+cey+" updated to "+value+ " successfully!")
return
print("Setting "+cey+" does not exist! Cannot update a non-existing setting.")
def delete_setting(dictionary,item):
item = item.lower()
for key in dictionary.keys():
if key == item:
dictionary.pop(item)
print("Setting '"+item+"' deleted successfully!")
return
print("Setting not found!")
def view_settings(dictionary):
if len(dictionary) == 0:
print("No settings available.")
else:
print("Current User Settings:")
for setting, waarde in dictionary.items():
print(setting.capitalize(),":", waarde)
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36
Challenge Information:
Build a User Configuration Manager - Build a User Configuration Manager
Please carefully review the user stories about the messages you are displaying. Are you asked to print() them?
Don’t some of the messages ask you to enclose keys and/or values in single quotes?
Are you asked to print() the string in view_settings? And is that string formatted exactly as shown in the instructions? Carefully check spacing, please.