In Phyton, The main point of inheritance is to take advantage of existing functionality. There areseveral ways to do this and reasons for doing this, and one of them is to create newbehavior that's similar to, but distinct from, an existing class. For example, Pythoncomes not just withdict, but also with Counter and defaultdict. By inheriting from dict, those two classes can implement just those methods that differ from dict, relyingon the original class for the majority of the functionality. In this exercise, write a subclass of dict, which called FlexibleDict. Dict keysare Python objects, and as such are identified with a type. So if you use key 1 (aninteger) to store a value, then you can't use key 'l' (a string) to retrieve that value. But FlexibleDict will allow for this. If it doesn't find the user's key, it will try to convert the key to both str and int before giving up. The specification of FlexibleDict indicates that everything should work just likea regulardict, except for retrievals. You thus only need to override one method, thegetitemmethod that's always associated with square brackets in Python. In otherwords, a[b]I s turned into a._getitem_(b). Execute the following code in your program. It should work properly. fd = FlexibleDict() fd['a'] = 100 print (fd['a']) fd[5] = 500 print (fd [5]) fd[1] = 100 print (fd['1']) fd['1'] = 100 print(fd[1]) = = In Phyton, The main point of inheritance is to take advantage of existing functionality. There areseveral ways to do this and reasons for doing this, and one of them is to create newbehavior that's similar to, but distinct from, an existing class. For example, Pythoncomes not just withdict, but also with Counter and defaultdict. By inheriting from dict, those two classes can implement just those methods that differ from dict, relyingon the original class for the majority of the functionality. In this exercise, write a subclass of dict, which called FlexibleDict. Dict keysare Python objects, and as such are identified with a type. So if you use key 1 (aninteger) to store a value, then you can't use key 'l' (a string) to retrieve that value. But FlexibleDict will allow for this. If it doesn't find the user's key, it will try to convert the key to both str and int before giving up. The specification of FlexibleDict indicates that everything should work just likea regulardict, except for retrievals. You thus only need to override one method, thegetitemmethod that's always associated with square brackets in Python. In otherwords, a[b]I s turned into a._getitem_(b). Execute the following code in your program. It should work properly. fd = FlexibleDict() fd['a'] = 100 print (fd['a']) fd[5] = 500 print (fd [5]) fd[1] = 100 print (fd['1']) fd['1'] = 100 print(fd[1]) = =