I just started using Python today for my class and one of my problems is cubing a number in Python. I know the way to do it is x^3
, but that doesn't work in Python. I was just wondering how I would be able to do that.
This is what I tried so far, but as you can see, I keep getting syntax errors:
>>> def volume (v) :
return v^3
volume(4)
SyntaxError: invalid syntax