3 ms·
In pretty much any language other than python you'd have to be careful for the case that i might become negative anyway. And in python you could just go:
by contravariant 7y ago
In pretty much any language other than python you'd have to be careful for the case that i might become negative anyway.
And in python you could just go:
import itertools as it
a = ''.join(it.islice(it.cycle("abc"),10))
Also you don't need 0 to form a ring. Modulo arithmetic forms a ring no matter which representatives you pick. Languages just tend to implement one that includes 0 because it's more convenient.