Challenge: Working with the While Loop
Uppgift
Swipe to start coding
-
Create a variable named
i
and set it to1
. -
Begin a
while
loop that runs for numbers from1
to9
(inclusive). Inside the loop, do the following:- Print the square of
i
; - Increment
i
by1
.
- Print the square of
Lösning
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 5. Kapitel 2
single
Fråga AI
Fråga AI
Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal
Suggested prompts:
Sammanfatta detta kapitel
Explain code
Explain why doesn't solve task
Awesome!
Completion rate improved to 1.64
Challenge: Working with the While Loop
Svep för att visa menyn
Uppgift
Swipe to start coding
-
Create a variable named
i
and set it to1
. -
Begin a
while
loop that runs for numbers from1
to9
(inclusive). Inside the loop, do the following:- Print the square of
i
; - Increment
i
by1
.
- Print the square of
Lösning
Var allt tydligt?
Tack för dina kommentarer!
Awesome!
Completion rate improved to 1.64Avsnitt 5. Kapitel 2
single