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

Merge branch '14-fix-the-show-method' into 'main'

Resolve "Fix the show method"

Closes #14

See merge request !13
parents 8c4e1d67 efb3ccc1
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.
Finish editing this message first!
Please register or to comment