Pick random choice from variables

Joel Goldstick joel.goldstick at gmail.com
Sun Feb 10 12:43:23 EST 2013


On Sun, Feb 10, 2013 at 12:01 PM, eli m <techgeek201 at gmail.com> wrote:

> How do i make something with python that will ask the user for input, and
> then use the random.choice function to select a random choice from what the
> user entered.
>
l = [1,2,3] # or any list

r = random.choice(l)

> --
> http://mail.python.org/mailman/listinfo/python-list
>



-- 
Joel Goldstick
http://joelgoldstick.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130210/3b4b1fd4/attachment.html>


More information about the Python-list mailing list