Relative Content

Tag Archive for pythonnumbers

rounded numbers coding

there is no decimal number on my coding but rounded numbers. by writing code the parenthesis are also black but get errors to invalid decimal literal on output. why?

Is there a simple way to do number operations in a limited number space in python?

I want to know if there is a simple method to do number equations in a limited number space like 0 and 40 or 0 and 1000? Even better if there is a way for a numbers to go back. For example, have a number space between 0 and 8. Then do operation 4 + 7 which would be equal to 11(over 8) and then this number will go back to 5, because 4 + 4 would be 8 and because there is still a residue of 3(7 – 4 = 3) which then equal to 8 – 3 which is 5. And vice versa with substraction where 3 – 4 would be equal to 1 in a 0 to 8 number space.