15 lines
439 B
Python
15 lines
439 B
Python
import itertools
|
|
|
|
|
|
class PolyIntField:
|
|
|
|
def __init__(self, int_modulo, poly_modulo):
|
|
self.int_modulo = int_modulo
|
|
self.poly_modulo = poly_modulo
|
|
self.elements = list(itertools.product([x for x in range(0, int_modulo)]
|
|
, repeat=len(poly_modulo) - 1))
|
|
|
|
if __name__ == "__main__":
|
|
a = PolyIntField(3, [1, 1, 2, 2])
|
|
print(a.elements)
|
|
print(len(a.elements)) |