umich 101 runestone1 [Notes] Ch.14 Iteration (Runestone) I. While Loop 1. While loop (1) While loops execute a block of code as long as some condition is true. (2) If we start x at 0, and count while x < N, we iterate N times (with x as 0,1,..., N-1) 2. Hint on Creating While Loops Some of the trickier parts of writing a correct while loop are: (1) Where does it start? ex) “what gets initialized before the loop starts? And to what value?” (2) When doe.. 2022. 11. 18. 이전 1 다음