0

can anyone help me

x = 0 while x >= 10 : print(x) if x == 2 : print("Skipping 2") break x = x + 1 how to fix this it says No Output.

2nd Mar 2023, 6:27 AM
zeka
zeka - avatar
3 Respuestas
+ 3
Because your condition never gonna true set the value of x more than 10 see here while(x>=10) 0>=10 // false That's why while loop body statement won't execute
2nd Mar 2023, 6:44 AM
💫As💫
💫As💫 - avatar
+ 3
As ASR said you need to change your while statement to: while x <= 10: (while x is less than or equal to 10)
2nd Mar 2023, 8:55 AM
Ausgrindtube
Ausgrindtube - avatar
+ 1
x = 0 while x >= 10 : print(x) if x == 2 : print("Skipping 2") break; x = x + 1 I think this is the right code I am a beginner I show you what I could 😉 how to fix this it says No Output.
2nd Mar 2023, 8:43 AM
Nuha Samson
Nuha Samson - avatar