Qualcomm interview question

Basic programs in python and maths question