Can a for loop be used outside of loop?