+ 2
2nd argument value is default argument. Means if that key not exists in dictionary then it returns default value specified. So fib.get(4, 0) returns 3 because key 4 exists having value 3. fib.get(7, 5) returns 5 because key 7 not existing.. dict.get(key) returns error if key not exists... dict.get(key, default) returns value if key exists, otherwise returns default value...
31st Oct 2022, 9:29 AM
Jayakrishna 🇼🇳