[Tutor] functions

Matthew Lintern lintern121184 at gmail.com
Tue Dec 15 06:19:33 EST 2015


Hello,

I'm new to python and I've been following some youtube videos etc to learn
python. I'm using the spyder IDE.  Im having problems with the following
piece of code:

def myfun(x):
    y=x**2
    return y

print myfun(5)

the answer I should get is obviously 25, and this is the case in the video
(https://www.youtube.com/v/GT1UfkLIeZ4?version=3&vq=hd1080&autoplay=1)

However, Spyder tells me theres a syntax error with myfun(5).  However, the
videos shows no issue....?

Any help is greatly appreciated!

Thanks

Matt


More information about the Tutor mailing list