0
Where is the problem?While loop is not working.I want to start my sentence to write from end.Sorry my english.
3 Antworten
+ 3
While loop works when the condition is true. But in your program, the condition is 'count==0'. This means while loop will only work when count is 0. But if you input something, count becomes the count of sentence, not 0. So change 'count==0' to 'count!=0'. Then it will work.
+ 2
First recommendation: write comments explaining what you are trying to achieve.
By looking at your code, I pressume you want to print the words in reverse order.
the reason it doesn't work is because the condition inside the while loop is always false.
count is always going to be bigger than 0 (unless the user does not type anything). therefore this happens
count == 0 #false
you should check for whenever count is bigger than 0
count > 0 # true
then your while loop should work
0
thanks.