0

[SOLVED] why no output?

x = int(input()) while x <= 1: print(x) x = x - 1

1st Jan 2022, 3:12 PM
FerutiiA1t
FerutiiA1t - avatar
2 ответов
+ 3
You may change the condition to x >= 1
1st Jan 2022, 3:18 PM
FanYu
FanYu - avatar
+ 3
It depends on what you give as input: if your input is > 0, it will not run at all; if your input is <= 1, it will run infinitely as you decrease x on each iteration
1st Jan 2022, 3:17 PM
Lisa
Lisa - avatar