python for loop based on integer