Post

.
.@asjfoiegnl·
@PythonPr x = 1 Check 1 < 3 → True → enter loop → x = 2 Check 2 < 3 → True → enter loop → x = 3 Check 3 < 3 → False → exit loop print(x) → outputs 3
English
0
0
6
457
Robin Fultz
Robin Fultz@robin16633·
@PythonPr 3 Because the print command is outside the while loop and will only print the final product of that loop.
English
0
0
4
409
Harish
Harish@tweet_harry00·
@PythonPr 3 x=1 -> while loop runs -> x=2 x=2 -> while loop runs -> x=3 x=3 -> while loop condition fails Final x value is 3
English
0
0
2
331
Evil Dead
Evil Dead@EvilDead·
Every family has its demons. Evil Dead Burn only in theaters July 10. Get Tickets Now!
English
0
4
54
108.7K
Yu
Yu@0WJyiDeWQ9ziBdj·
@PythonPr 3 Because it ends 3 after x breaks out of a loop
English
0
0
1
420
Nafo_FAFO_Nafo
Nafo_FAFO_Nafo@Nafo_FAFO_Nafo·
@PythonPr 3, 2 is < 3, which means there is another run through the loop. Then it ends through 3 < 3, which is false and prints the result.
English
0
0
1
216
Guillaume GAY
Guillaume GAY@GayGuillaume7·
@PythonPr 2 then 3. the increment runs before print, which is the whole trick
English
0
0
0
1
Gopuff
Gopuff@gopuff·
Our delivery comes with a genius. Go learns what you like, builds your cart in seconds, and gets it all to your door in as fast as 15 minutes.
English
12
39
825
7.2M
Paylaş