Various ways to loop in python