Appropriate variables for while loops


#1

Hey all:)

So I have a hard time figuring out what variable I can use in While loops, and I tried researching my way to what variable is possible to use in general, but it did not come of as clear as wanted.

So I know variables can be numbers or strings, but also be true or false.
My problem is though, what types of variables can I use and how does the while loop react?

This question also includes the fact that its a necessity to close the loop so it doesn't become infinite.
Given that info, I wont be able to use a number or string, right?

Then, final q, what type of variables can I use?

Thanks in advance.


#2

A while-loop doesn't interact with variables. It is only concerned with the result of the boolean expression that is evaluated each iteration. That expression can refer to any values you want it to, as long as the result is boolean.