x+=5 if x+5<10 else 0
In this above example i should add 5 to x if x+5 is less than 10.
but as you can see i am calculating x+5 two times how can i do without repeating it.
like
"add x to 5 if it doesnt become greater than 10 after adding"
is this possible on python? if yes then how do you do that?
x? Does it have to use a conditional expression? What actually is the question here?