(ie. b)
> >
> > How can I do it the above way or do I still have to go like this..
> >
> > def foo()
> > return {"a":"b", "b":"c"}
> >
> > z = foo()
> > if z:
> >print "Have foo"
> >
ie. b)
>
> How can I do it the above way or do I still have to go like this..
>
> def foo()
>return {"a":"b", "b":"c"}
>
> z = foo()
> if z:
>print "Have foo"
>print z['a']
>
> This is where
rh0dium:
> This is where $_ in perl is awesome - There must be a default variable
> in python right?
A default variable may add bugs to your code, and newbies of the
language may see it coming from air, so Python avoids such things. The
only Python "default variable" I know of is
nary item a (ie. b)
>
> How can I do it the above way or do I still have to go like this..
>
> def foo()
>return {"a":"b", "b":"c"}
>
> z = foo()
> if z:
>print "Have foo"
>print z['a']
>
> Th
.
def foo()
return {"a":"b", "b":"c"}
z = foo()
if z:
print "Have foo"
print z['a']
This is where $_ in perl is awesome - There must be a default variable
in python right?
--
http://mail.python.org/mailman/listinfo/python-list