Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # reflected_mod.py
- def reflected_mod(n, mod):
- r = n % (2 * mod)
- return mod - abs(mod - r)
- for i in range(20):
- print(f"{i} -> {reflected_mod(i, 5)}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement