Moody's interview question

Technical Questions on python mostly.