You need to give eq
a self
parameter, and create an instance of formula
by calling it:
class formula():
def eq(self):
print "What is your Velocity: "
v = float(raw_input())
print "What is your Intial Velocity: "
u = float(raw_input())
print "What is the time: "
t = float(raw_input())
aa = v-u
answer = aa/t
print "Your Acceleration is: ", answer
formula().eq()
There is no point in storing the return value, you don't return anything here.
I note that you don't actually use anything in your function that requires a class. You could just as well leave the class out here and not lose anything
def eq():
print "What is your Velocity: "
v = float(raw_input())
print "What is your Intial Velocity: "
u = float(raw_input())
print "What is the time: "
t = float(raw_input())
aa = v-u
answer = aa/t
print "Your Acceleration is: ", answer
eq()
If you wanted to put your formula in a namespace, put it in a separate module instead; put def eq()
in a file formula.py
and import that as import formula
. No point in making eq()
a staticmethod
here, really.