Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #38588

Re: Pick random choice from variables

References <2b79c66b-0750-46c5-a436-edf369747af2@googlegroups.com>
Date 2013-02-10 12:43 -0500
Subject Re: Pick random choice from variables
From Joel Goldstick <joel.goldstick@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.1591.1360518212.2939.python-list@python.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Sun, Feb 10, 2013 at 12:01 PM, eli m <techgeek201@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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Pick random choice from variables eli m <techgeek201@gmail.com> - 2013-02-10 09:01 -0800
  Re: Pick random choice from variables Joel Goldstick <joel.goldstick@gmail.com> - 2013-02-10 12:43 -0500
  Re: Pick random choice from variables David Hutto <dwightdhutto@gmail.com> - 2013-02-10 13:01 -0500
  Re: Pick random choice from variables David Hutto <dwightdhutto@gmail.com> - 2013-02-10 13:03 -0500

csiph-web