-> replaced un-changed lists by tuples for better runtime & memory savings.
-> removed str conversion ahead of input as it always returns a string.
-> removed unnecessary 'return None' statements.
-> optimized for loops.
-> removed multiple unnecessary print statements and converted into a single one.
-> updated guard clause in return statement in fetch function.
-> other minor optimizations.
Made the following changes:
-> replaced un-changed lists by tuples for better runtime & memory savings. -> removed str conversion ahead of input as it always returns a string. -> removed unnecessary 'return None' statements. -> optimized for loops. -> removed multiple unnecessary print statements and converted into a single one. -> updated guard clause in return statement in fetch function. -> other minor optimizations.