test for None

E

Erik Max Francis

B

Ben Finney

BartlebyScrivener said:
How do you test for a function that returns nothing,

A function returns a single value (which may be a container for other
values). By default, with no 'return' statement, it returns the None
object.

What is it you're trying to do?
and why doesn't
this work? Shouldn't X have to be either None or not?
Yes.

Assigns the name 'x' to the None object.

Iterates over an empty list, which results in zero iterations;
i.e. does nothing.

Have you followed the tutorial through, running and understanding each
example, to get the basics of Python covered?

<URL:http://docs.python.org/tut/>
 
B

BartlebyScrivener

Have you followed the tutorial through, running and understanding each
Could be high time to try that again. At first it was way too much, so
I've been doing Dive Into Python and some others. But I will try the
Tutorial again, at least up to classes. Then I'm sure I'll have to
return to the books.

Thanks for your patience.

rick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,294
Messages
2,571,508
Members
48,193
Latest member
DannyRober

Latest Threads

Top