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


Groups > comp.lang.python > #54154

Need help to sort out the below code...

X-Received by 10.66.161.40 with SMTP id xp8mr4758809pab.39.1379140448138; Fri, 13 Sep 2013 23:34:08 -0700 (PDT)
X-Received by 10.50.2.74 with SMTP id 10mr262279igs.15.1379140448099; Fri, 13 Sep 2013 23:34:08 -0700 (PDT)
Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!y3no23600523pbx.0!news-out.google.com!z6ni49743pbu.0!nntp.google.com!y3no23600519pbx.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.python
Date Fri, 13 Sep 2013 23:34:07 -0700 (PDT)
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=123.237.213.52; posting-account=0JSLUwoAAABtzSO6lS1wijqfLybAV-Yb
NNTP-Posting-Host 123.237.213.52
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <9f6d4a88-4ae4-4e61-9f73-c074ec3f487f@googlegroups.com> (permalink)
Subject Need help to sort out the below code...
From mnishpsyched <mnish1984@gmail.com>
Injection-Date Sat, 14 Sep 2013 06:34:08 +0000
Content-Type text/plain; charset=ISO-8859-1
Xref csiph.com comp.lang.python:54154

Show key headers only | View raw


Hello guys,
i am new to programming and trying to solve this small coding: my purpose is to take in values from the user based on a menu provided for selection

the output looks like this...

please select from the following menu:
1. pizza
2. steak
3. pasta
4. burger
type in any number from above for selection..

you have selected: 1. Pizza
The bill amounted for Pizza is $20 along with tax of $0.15 will make upto $20.15 

the code i have written for this is as follows:

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)

if pz == 1 :
    print "You have selected", pz, ".pizza"
    pr_pz = 20
    tx_pz = 0.15
    tot = pr_pz + tx_pz
    print "The bill amounted for Pizza is $", pr_pz, "along with tax of $", tx_pz, "will make upto $", tot
elif st == 2 :
    print "You have selected", st, ".Steak"
    pr_st = 40
    tx_st = 0.20
    print "The bill amounted for Steak is $", pr_st, "along with tax of $", tx_st, "will make upto $", tot.....................
...........................
but my program doesn't output the selection once i type in any number from the list..Please help me to sort it out...

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


Thread

Need help to sort out the below code... mnishpsyched <mnish1984@gmail.com> - 2013-09-13 23:34 -0700
  Re: Need help to sort out the below code... Terry Reedy <tjreedy@udel.edu> - 2013-09-14 03:50 -0400
  Re: Need help to sort out the below code... Jugurtha Hadjar <jugurtha.hadjar@gmail.com> - 2013-09-14 09:38 +0100
  Re: Need help to sort out the below code... John Gordon <gordon@panix.com> - 2013-09-14 14:42 +0000

csiph-web