EXTREME NOOB, lists?

skeetor skeetornospam at bellsouth.net
Mon Sep 4 19:17:26 EDT 2000


Much thanks, it works like a charm.

"Will Ware" <wware at world.std.com> wrote in message
news:G08sq7.A94 at world.std.com...
> skeetor (skeetornospam at bellsouth.net) wrote:
> > I want to combine all the elif statements with the if statement to say.
> > "if a is equal to any number in list x then print a's range"
>
> Try this:
>
> if a in [4, 6, 8, 10, 20, 50, 100]:   # or whatever the exact list is...
>     dice_numbers(a)
> else:
>     print "try again"
>
> --
> # - - - - - - - - - - - - - - - - - - - - - - - -
> # Resistance is futile. Capacitance is efficacious.
> # Will Ware email:    wware @ world.std.com





More information about the Python-list mailing list