0

why isn't there a output

a=1 b=5 c=8 while(a>c): a=a+1 c=c-1 print(c)

4th May 2017, 1:41 PM
mayura sampath Wickramasinghe
mayura sampath Wickramasinghe - avatar
3 Answers
+ 5
The varible a is equal to 1 which is smaller than the value of c which is 8. The condition in the while loop (a>c) is false and the statements inside the while loop are not executed.
4th May 2017, 1:47 PM
Billy Tsouvalas
+ 7
while loops work as long as the statement evaluates to True. Since a is not greater than c, the code won't work.... try while c > a
4th May 2017, 1:47 PM
Daniel Hisa (1,2,3, Let'sCode!)
Daniel Hisa (1,2,3, Let'sCode!) - avatar
0
ty for the answers
4th May 2017, 4:15 PM
mayura sampath Wickramasinghe
mayura sampath Wickramasinghe - avatar