is a while loop always an indefinite loop? Building on this example and others found elsewhere we have two types of loops, definite and indefinite:

definite being a loop that has its number of iterations known before it is executed. E.g. a for loop:

for x in range(1,10):


and indefinite loops which don't have the number of iterations known before it is executed. E.g. this while loop:

while answer &lt;&gt; "Yes":
    answer = input("are you an idiot?")


I'm checking some teaching materials that have an example of a while loop that looks definite to me as by looking at the code you know exactly when it is going to end:

number = 1
while  number &lt;= 10:
    print(number)
    number = number +1


Is this example a definite loop even though we have to do a little work to work out the for loop equivalent?
Yes, this is definite loop, as long as you (or your compiler for that matter) can infer number of passes.
In some languages (like C), 'for' is a transformation that expands during compilation to 'while' construction like you have shown. Compiler would infer number of steps during optimisation phase, when you have provided constant expression loops of any kind, but will not infer that from variable expressions.