for loop and Nested for Loop in Python