Skip to content
Snippets Groups Projects
Commit efb3ccc1 authored by jonas.stirnema's avatar jonas.stirnema
Browse files

Hopefuly FIXED show method

parent 8c4e1d67
No related branches found
No related tags found
1 merge request!13Resolve "Fix the show method"
......@@ -9,19 +9,16 @@ class polynome():
self.prime_mod = 229
def show(self):
# TODO: OPTIMIZE IFs
for i in range(len(self.coefs) - 1, -1, -1):
power = ""
if self.coefs[i] != 0:
coef = str(self.coefs[i])
if i != 0: # its not 0's degree
power = f"x^{i} + "
else:
coef = ""
if i != 0:
power = f"x^{i} +"
else:
power = ""
print(f"{coef}{power} ", end="")
print()
print(f"{coef}{power}", end="")
print() # new line
def add(self, poly_2):
coeff_poly_1 = self.coefs
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment