SOLUTION for the problem with Python(3.5)


#1

def main():
my_dict = {
“Monday”: 1,
“Tuesday”: 2,
“Wednesday”: 3,
“Thursday”: 4,
“Friday”: 5,
“Saturday”: 6,
“Sunday”: 0
}

# update value for key "Sunday" to 7

del my_dict["Sunday"]
my_dict["Sunday"] = 7
my_dict["Default"] = 0
# adding another item with key "Default" having value 0

for i in sorted(my_dict):
    print ("(\'" + i + "\',", str(my_dict[i]) + ")")

return 0

#2

Yeah, Cool but
This does the job of changing the value of “Sunday” key

my_dict["Sunday"] = 7

You don’t have to do this

del my_dict["Sunday"]