For loop with lists and few python commands