Ask your own question, for FREE!
Python Syntax 17 Online
OpenStudy (anonymous):

I am a python noob and I'm using Python Idle 2.7.7. How do I print "def" program results in the shell? Can someone please explain it to me?

OpenStudy (anonymous):

you're going to use print(). copy paste the function so I can take a look at it.

OpenStudy (rsmith6559):

def in Python DEFines functions. Frequently functions return a value, sometimes they don't. To return a value in a function, it needs a return statement.

OpenStudy (anonymous):

Assuming you have already set up your function(the def program you speak of) to return a value, it is as simple as typing the following: print my_function(args) Where args are your arguments, e.g. a value you pass into the function

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!