a little help with my program?

johnston112 gordonj at paradise.net.nz
Mon Apr 2 01:24:30 EDT 2001


I am trying to make a program that does performs the quadratic function.
Here is the code:

import math

a = input ("Input a ")
b = input ("Input b ")
c = input ("Input c ")

x.real = -(b) + pow(b**2 - 4(a)(c)) / 2
print x


I hope I have the actual formula right :P
But thats not the point :) It dosn't go, could someone tell me how to fix
it, or just a hint even, which would be better, to make me tihnk for myself
(I am only new to python).
Here is what it shows when i run it:

Traceback (innermost last):
    File "d:\hacking\source\python\qf.py", line 7, in ?
        x.real = -(b) + pow(b**2 - 4(a)(c)) / 2
TypeError: call of non-function (type int)

So thats what I get. I have x.real because that is a floating point number
(?) and it said something about a int type, so thats why I tried it.

Anyway, any help will be appreciated.

johnston112





More information about the Python-list mailing list