Hi could someone help with this code,i am getting the error: " 'int' object is not iterable " at line 28(A.extend(n)) since i am new to python i am unable to figure out a solution any help is appreciated
Edit:I tried append earlier and got a memory error earlier and was wondering if extend() was the correct way to add elements but it seems like I made a mistake and the ended up with a infinite loop Thanks for the advice it really helped me
print("Ax^2+Bx+C")
a = int(input("a"))
b = int(input("b"))
c = int(input("c"))
i, j, k, l = 0, 0, 0, 0
A = []
C = []
B = []
ano = []
bno = []
no = 0
noc = 0
n = 2
a2 = a
c2 = c
if (a != 1) or (b != 1):
while i != 1:
while a2 % n == 0 and c2 % n == 0:
if a2 % n == 0:
a2 /= n
# A.extend(n)
no += 1
if c2 % n == 0:
c2 /= n
# A.extend(n)
no += 1
A.extend(n)
ano.extend(no)
no = 0
n += 1
if a2 == 1:
A.extend(1)
A.extend(1)
i = 1