I don not know whether this is the bug in pythonista3 or not?

class Quadratic_Functions_4_1:

```
def QFY(x,a,b,c):
y=a*x**2+b*x+c
print('the y is',y)
def QFX(y,a,b,c):
delta=b**2-4*a*(c-y)
if delta<0:
print('the function does not exist.')
if delta==0:
x=-b/2
print('the x is',x)
else:
x1=x=(-b+(delta**(1/2)))/(2*a)
x2=x=(-b-(delta**(1/2)))/(2*a)
print('x1 is',x1)
print('x2 is',x2)
def QFA(x,y,b,c):
if x==0:
print('the function is a line:')
else:
a=(y-b*x-c)/x**2
print('the a is',a)
def QFB(x,y,a,c):
if x==0:
print('the function is a line:')
else:
b=(y-a*x**2-c)/x
print('the b is',b)
def QFC(x,y,a,b):
c=y-a*x**2-b*x
print('the c is',c)
```

When I ran this code in pythonista3, I received the following sentences:

]]>q=Quadratic_Functions_4_1()

q.QFY(1,2,3,4)

Traceback (most recent call last):

File "<string>", line 1, in <module>

TypeError: QFY() takes 4 positional arguments but 5 were given

I don not know whether this is the bug in pythonista3 or not?

class Quadratic_Functions_4_1:

```
def QFY(x,a,b,c):
y=a*x**2+b*x+c
print('the y is',y)
def QFX(y,a,b,c):
delta=b**2-4*a*(c-y)
if delta<0:
print('the function does not exist.')
if delta==0:
x=-b/2
print('the x is',x)
else:
x1=x=(-b+(delta**(1/2)))/(2*a)
x2=x=(-b-(delta**(1/2)))/(2*a)
print('x1 is',x1)
print('x2 is',x2)
def QFA(x,y,b,c):
if x==0:
print('the function is a line:')
else:
a=(y-b*x-c)/x**2
print('the a is',a)
def QFB(x,y,a,c):
if x==0:
print('the function is a line:')
else:
b=(y-a*x**2-c)/x
print('the b is',b)
def QFC(x,y,a,b):
c=y-a*x**2-b*x
print('the c is',c)
```

When I ran this code in pythonista3, I received the following sentences:

]]>q=Quadratic_Functions_4_1()

q.QFY(1,2,3,4)

Traceback (most recent call last):

File "<string>", line 1, in <module>

TypeError: QFY() takes 4 positional arguments but 5 were given

```
def QFY(self,x,a,b,c):
```

]]>`q = Quadratic_Functions_4_1`

and `q = Quadratic_Functions_4_1()`

(note the parentheses at the end).
Also, it looks like you might not need to use a class here at all. Your current code would work just fine if you move the functions out of the class, then you can use `QFY(1, 2, 3, 4)`

directly (without `q`

before it).

```
class Quadratic_Functions_4_1:
@staticmethod
def QFY(x,a,b,c):
y=a*x**2+b*x+c
print('the y is',y)
```

]]>On my Mac:

class Quadratic_Functions_4_1:

def QFY(x,a,b,c):

y=a*x**2+b*x+c

print('the y is',y)

Run on my Mac:

Q=Quadratic_Funtions_4_1()

Q.QFY(1,4,8,10)

the y is 22

class quadratic_functions:

def qfx(self,y,a,b,c):

delta=b

if delta==0:

x=-b/2

print('the x is',x)

if delta<0:

print('there is no solution for x.')

else:

x1=x=(-b+delta

x2=x=(-b-delta**(1/2))/(2*a)

print('x1 is',x1)

print('x2 is',x2)

When I run it on my Mac and pythonista3:

q=quadratic_functions()

q.qfx(1,4,8,10)

there is no solution for x.

It works.

Or when I code like this:

class quadratic_functions:

def qfx(y,a,b,c):

delta=b* 2-4a*(c-y)

if delta==0:

x=-b/2

print('the x is',x)

if delta<0:

print('there is no solution for x.')

else:

x1=x=(-b+delta

x2=x=(-b-delta**(1/2))/(2*a)

print('x1 is',x1)

print('x2 is',x2)

When I run it on my Mac and pythonista3:

q=quadratic_functions

q.qfx(1,4,8,10)

there is no solution for x

It works.

]]>I think I can't help you more, I'm not a Python specialist but in this forum I'm sure other guys could help you. ]]>

```
q=quadratic_function()
```

In the other case, you are referring to the class:

```
q=quadratic_function
```

These are two completely different things. The first creates an instance, and binds the instance to the first argument, thus requires `self`

as first argument. The second does not, so does not need a `self`

.

what version of python are you running on the mac?

are you using the console, or executing a file?

are you using jupyter or IPython or some other nonstandard interpreter?

The only other thought... since your class does not inherit from object, on 2.x this will be an "old style class", so might behave a little differently. But I think even old style classes would have bound instances to their methods.

]]>