Question: The below program is written to change the value of given dictionary such that the value word starts with upper case. However only the first
The below program is written to change the value of given dictionary such that the value word starts with upper case. However only the first value is changed with this program. Fix the program so that all values are changed.
key_values = {1:'michigan', 2:'detroit', 3:'southfield', 4: 'troy'}
def fix_key_value(key_values): for x in key_values: key_values[x] = key_values[x].title() return
fix_key_value(key_values) key_values
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
