Conditional structures: Difference between revisions

Content added Content deleted
Line 3,030: Line 3,030:
}
}
# ...
# ...
dispatcher.get(x, boz)()</lang>
results = dispatcher.get(x, boz)()</lang>


<lang python># Or without the temp variable
<lang python># Or without the temp variable
# (it's up to the reader to decide how "pythonic" this is or isn't)
# (it's up to the reader to decide how "pythonic" this is or isn't)
results = {
{
0: foo,
0: foo,
1: bar,
1: bar,