I know this code works, but is it correct to define them as functions or should I use something else?
import math
def Fibonnacci_sequence():
i=int(input("How many numbers of the fibonnacci sequence do you want to see: "))
a = 1
b = 1
n = 1
print(a)
print(b)
n = n + 1
while n < i:
c = a + b
print(c)
n = n + 1
a = b
b = c
def Fib_seqnum():
i=int(input("What number of the fibonnacci sequence do you want to know: "))
a = 1
b = 1
n = 1
n = n + 1
while n < i:
c = a + b
n = n + 1
a = b
b = c
print(c)
def solve_qaudratic():
a=float(input("Enter A: "))
b=float(input("Enter B: "))
c=float(input("Enter C: "))
d = (b*b) - 4*a*c
if d < 0:
print("No real roots")
elif d == 0:
x = -b/(2*a)
print("equal roots" (x))
else:
x = math.sqrt(d)
i = (-b -x)/(2*a)
o = (-b +x)/(2*a)
print("X1 = " (i))
print("X2 = " (o))
print("Welcome to maths")
print("PRESS 1 TO LOOK AT THE FIBONNACCI SEQUENCE")
print("PRESS 2 TO SOLVE A QUADRATIC")
print("PRESS 9 TO EXIT")
answer=int(input("Enter Choice: " ))
if answer==1:
Fibonnacci_sequence()
elif answer==2:
solve_qaudratic()
elif answer==3:
Fib_seqnum()
elif answer==9:
exit()
else:
print("WHAT?!")
print()
calls insolve_qaudratic()
aren't syntactically valid. Please ensure that the code works as posted. \$\endgroup\$TypeError: 'str' object is not callable
\$\endgroup\$