Output of code ina column, loops in python