Reputation: 88678
When working in Python, let's say I have a long bytes
object. I want to get it modulo some number. For example, say I have the bytes object b'hi' and I want it modulo 3, then the result is 26729 % 3 == 2. (The bytes
object is seen as one big number.)
How do I do that in Python? (Preferably Python 3.) I'm hoping that there's a relatively elegant way where I don't have to manually compute the number.
Upvotes: 4
Views: 1398