Various functions and solved problems in python