Path: csiph.com!usenet.pasdenom.info!goblin3!goblin.stu.neva.ru!newsfeed2.funet.fi!newsfeeds.funet.fi!news.cc.tut.fi!not-for-mail From: Anssi Saari Newsgroups: comp.lang.python Subject: Re: Beginner question Date: Tue, 04 Jun 2013 10:45:38 +0300 Lines: 13 Message-ID: References: <323f2f5b-1f50-4689-90b8-74c411e43971@googlegroups.com> NNTP-Posting-Host: 2001:708:310:3430:5c90:67ab:1a5f:9afd Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.cc.tut.fi 1370331938 7682 2001:708:310:3430:5c90:67ab:1a5f:9afd (4 Jun 2013 07:45:38 GMT) X-Complaints-To: abuse@tut.fi NNTP-Posting-Date: Tue, 4 Jun 2013 07:45:38 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) Cancel-Lock: sha1:29SdQUQUUtLWKA+dO33pgGNMXc4= Xref: csiph.com comp.lang.python:46849 eschneider92@comcast.net writes: > Is there a more efficient way of doing this? Any help is gratly appreciated. Efficiency in a short program isn't a big thing. You have some pretty weird things in there, there's no need make single element tuples out of your strings and then putting those in a list. Just put the strings in a tuple and go. Likewise there's really no point in having while loops where you exit on the first round now is there? Just use an if. BTW, did I get the logic correctly, the end result is random? If true then the logic can be simplified greatly, you can just discard the user input and print a random choice of your three result strings...