Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!news.linkpendium.com!news.linkpendium.com!panix!gordon From: John Gordon Newsgroups: comp.lang.python Subject: Re: Need help to sort out the below code... Date: Sat, 14 Sep 2013 14:42:51 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 48 Message-ID: References: <9f6d4a88-4ae4-4e61-9f73-c074ec3f487f@googlegroups.com> NNTP-Posting-Host: panix2.panix.com X-Trace: reader1.panix.com 1379169771 14989 166.84.1.2 (14 Sep 2013 14:42:51 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Sat, 14 Sep 2013 14:42:51 +0000 (UTC) User-Agent: nn/6.7.3 Xref: csiph.com comp.lang.python:54166 In <9f6d4a88-4ae4-4e61-9f73-c074ec3f487f@googlegroups.com> mnishpsyched writes: > print """ > Please select from the following menu: > 1. pizza > 2. steak > 3. pasta > 4. burger > type in any number from above for selection.. > """ > pz = raw_input() > pz = int(pz) > st = raw_input() > st = int(st) > ps = raw_input() > ps = int(ps) > bg = raw_input() > bg = int(bg) > but my program doesn't output the selection once i type in any number > from the list..Please help me to sort it out... That's because you're calling raw_input() four times, thus the user must type in a number four times. You probably want something like this: user_choice = raw_input() user_choice = int(user_choice) if user_choice == 1: print "You have selected", user_choice, ".pizza" .... .... elif user_choice == 2: print "You have selected", st, ".Steak" .... .... -- John Gordon A is for Amy, who fell down the stairs gordon@panix.com B is for Basil, assaulted by bears -- Edward Gorey, "The Gashlycrumb Tinies"