1newDict = {1:"One",
2 2:"Two",
3 3:"Three"}
4x=newDict.setdefault(4,"Four")
5print(newDict[4])
6#returns Four
7
8newDict2 = {1:"One",
9 2:"Two",
10 3:"Three",
11 "Hello":"World"}
12y=newDict.setdefault("Hello","Yellow")
13print(newDict2["Hello"])
14#returns World
15
16dict1 = {1:"One",2:"Two"}
17x=dict1.setdefault(3,"Three")
18x=dict1.setdefault(2,"Duo")
19print(dict1)
20#prints {1: 'One', 2: 'Two', 3: 'Three'}
21
22#Therefore if value doesn't exist it is given default value, else value of key is returned.
23