For Loop iterates each element from the list until the given range. So no need of any variable to check condition.
While Loop iterates until the given condition is true. Here we need some variable or value to check the condition, So the variable num is used before the loop.