+ 2

A useful programmer code

_age = input(int(:) while _age >= 10: print("keep on coding") if _age >= 80: print("please retire...you are too old") break

21st Nov 2016, 2:05 PM
Ben Ntabo
Ben Ntabo - avatar
3 Respostas
+ 3
You realise that if the input is 10 or above your script gets stuck in an infinite loop, right?
21st Nov 2016, 2:08 PM
Arthur Busser
Arthur Busser - avatar
+ 2
Nice but you need to insert the break statement at the right part. Really a loop is totally unnecessary here.
21st Nov 2016, 2:19 PM
NICKALL [EP]
NICKALL [EP] - avatar
+ 2
thanks guys for the correction am just learning how loops are working
21st Nov 2016, 5:31 PM
Ben Ntabo
Ben Ntabo - avatar