Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started