+ 2

What am I doing wrong here? I want it to print the value of x, not the letter x...

https://code.sololearn.com/cV4T1W4tGJ1J/?ref=app

17th Jul 2020, 8:56 PM
Reacy.Py
Reacy.Py - avatar
8 Réponses
17th Jul 2020, 9:07 PM
李立威
+ 2
x = 50 while x > 5: x = x - 5 print (x , "greater than") if x == 5: print ('FIVE') https://code.sololearn.com/cxlw20a0nb8c/?ref=app
18th Jul 2020, 12:57 AM
Reacy.Py
Reacy.Py - avatar
+ 2
My code is returning 5 is greater than 5 too
18th Jul 2020, 11:58 AM
Reacy.Py
Reacy.Py - avatar
+ 2
Thanks! Much appreciated!
18th Jul 2020, 9:20 PM
Reacy.Py
Reacy.Py - avatar
+ 1
Thanks a lot!.!.!
17th Jul 2020, 9:23 PM
Reacy.Py
Reacy.Py - avatar
+ 1
That's different than the way I remember learning it but that is the output I was attempting to get...
17th Jul 2020, 9:24 PM
Reacy.Py
Reacy.Py - avatar
+ 1
Is it more like this? x = 50 while x > 5: x = x - 5 print ('x' , ' is', x, " greater than") if x == 5: print ('FIVE')
18th Jul 2020, 12:50 AM
ikonne Bethel
+ 1
I was wondering about that too... I thought it should have jumped to the if statement at that point... I don't know why it's printing 5 when it should be going from 10 to printing out FIVE...
18th Jul 2020, 11:58 AM
Reacy.Py
Reacy.Py - avatar