iOS Swift Collections and Control Flow Control Flow With Loops While and Repeat While

counter question

if the counter = 1 then how is the statement counter < 1 true? I'm really confused

1 Answer

Alex Koumparos
Alex Koumparos
Python Web Development Techdegree Student 35,893 Points

Hi Ronald,

@Pasan says (at around 6:40):

This condition is TRUE already, so we never go into the body. So none of the contents of the while loop are evaluated.

He meant to say:

This condition is FALSE, so we never go into the body. So none of the contents of the while loop are evaluated.

Hope that clears up the confusion.

Cheers

Alex