Python Forum

Full Version: Substracting number with a limit
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,
I'm new to this forum since I'm starting to use Python at school.

In one of my homework, I need to be able to substract a meter when it will reach the limit of 999999999 from the new number ie: 000000027 so I will print the number 28

It might be easy so this is why I'm turning to this forum.

Thank you.
Are you asking how you would go about a counter that goes 0-999999999 <-- (that being the limit), then once it does it will subtract from a different number?
As for now since I'm substracting from the last number entered ie: 000000027 - 999999999, I will get a negative number. I need to find the twist to see 28 printed on screen.

Thanks.
I suggest you get out a pen and paper, and work out the basic principle of the arithmetic using a much smaller range. Say a meter that goes from 20 to 40.