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


Groups > comp.lang.python > #65252

Re: Help with some python homework...

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <swdunning@cox.net>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.061
X-Spam-Evidence '*H*': 0.88; '*S*': 0.00; 'calculating': 0.09; 'guys!': 0.09; 'lines.': 0.09; 'cc:addr:python-list': 0.11; 'subject:Help': 0.11; 'jan': 0.12; 'defined.': 0.16; 'subtract': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; '3.0': 0.19; 'received:10.0.1': 0.19; 'feb': 0.22; 'cc:addr:python.org': 0.22; 'print': 0.22; 'url:home': 0.24; 'guys': 0.24; 'question': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'defined': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'url:mailman': 0.30; 'code': 0.31; 'that.': 0.31; '-0700,': 0.31; 'subject:some': 0.31; 'you\x92re': 0.31; 'another': 0.32; 'url:python': 0.33; 'fri,': 0.33; 'could': 0.34; 'subject:with': 0.35; 'problem.': 0.35; 'but': 0.35; 'url:listinfo': 0.36; 'thanks': 0.36; 'received:10.0': 0.36; 'url:org': 0.36; 'received:10': 0.37; 'url:mail': 0.40; 'even': 0.60; 'removing': 0.60; 'header:Message- Id:1': 0.63; 'different': 0.65; 'chance': 0.65; 'charset:windows-1252': 0.65; 'price': 0.69; 'price.': 0.74; '100%': 0.77; '2014,': 0.84; '40%': 0.84; 'have?': 0.84; 'discount': 0.87; 'scott': 0.93
X-CT-Class Clean
X-CT-Score 0.00
X-CT-RefID str=0001.0A020201.52EDE05B.00FC,ss=1,re=0.000,fgs=0
X-CT-Spam 0
X-Authority-Analysis v=2.0 cv=E9kTU9hl c=1 sm=1 a=MB85R812cvcrhCHz/P2OVA==:17 a=lYmbDxrgSswA:10 a=G8Uczd0VNMoA:10 a=N659UExz7-8A:10 a=kviXuzpPAAAA:8 a=IFej2vUWUj8A:10 a=QrVWhbZvAAAA:8 a=8AHkEIZyAAAA:8 a=ReWRcmb8sHiylbkHIwIA:9 a=pILNOxqGKmIA:10 a=4vB-4DCPJfMA:10 a=MB85R812cvcrhCHz/P2OVA==:117
X-CM-Score 0.00
Authentication-Results cox.net; auth=pass (PLAIN) smtp.auth=swdunning@cox.net
Content-Type text/plain; charset=windows-1252
Mime-Version 1.0 (Mac OS X Mail 7.1 \(1827\))
Subject Re: Help with some python homework...
From Scott W Dunning <swdunning@cox.net>
In-Reply-To <M3sM1n00Q3bjUJS013sN0e>
Date Sat, 1 Feb 2014 23:06:18 -0700
Content-Transfer-Encoding quoted-printable
References <02c4c69d-71f1-4a01-86df-d4d5a7ffb3f5@googlegroups.com> <Lr8T1n00d3bjUJS01r8V2t> <C675418B-7F7C-4DF8-A313-99C716E42FDB@cox.net> <M3sM1n00Q3bjUJS013sN0e>
To Dennis Lee Bieber <wlfraed@ix.netcom.com>
X-Mailer Apple Mail (2.1827)
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.6299.1391321188.18130.python-list@python.org> (permalink)
Lines 41
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1391321188 news.xs4all.nl 2833 [2001:888:2000:d::a6]:35162
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:65252

Show key headers only | View raw


Yeah you’re right I didn’t even notice that.  For some reason I just added the 60 instead of using quantity which had been defined.  


On Feb 1, 2014, at 8:50 AM, Dennis Lee Bieber <wlfraed@ix.netcom.com> wrote:

> On Fri, 31 Jan 2014 22:18:34 -0700, Scott W Dunning <swdunning@cox.net>
> declaimed the following:
> 
>> Any chance you guys could help with another question I have?  Below is a code to a different problem.  The only thing I don’t understand is why when calculating the 'discounted price’ you have to subtract 1?  Thanks again guys!  
>> 
> 
> 	Because the discount rate you have is the amount taken OFF the price.
> But you need the price AFTER removing the discount amount 100% (1.0) - 40%
> (0.4) discount => 60% (0.6) final price
> 
>> price_per_book = 24.95
>> discount = .40
>> quantity = 60
>> discounted_price = (1-discount) * price_per_book
>> shipping = 3.0 + (60 - 1) * .75
>> total_price = 60 * discounted_price + shipping
>> print total_price, 'Total price'
>> 
> 	You defined "quantity" but then never used it in the shipping and
> total_price lines.
> -- 
> 	Wulfraed                 Dennis Lee Bieber         AF6VN
>    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list

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


Thread

Help with some python homework... scottwd80@gmail.com - 2014-01-30 21:12 -0800
  Re: Help with some python homework... Chris Angelico <rosuav@gmail.com> - 2014-01-31 16:30 +1100
    Re: Help with some python homework... sjud9227 <scottwd80@gmail.com> - 2014-01-30 22:24 -0800
      Re: Help with some python homework... Chris Angelico <rosuav@gmail.com> - 2014-01-31 17:38 +1100
        Re: Help with some python homework... sjud9227 <scottwd80@gmail.com> - 2014-01-30 22:48 -0800
      Re: Help with some python homework... Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-01-31 21:17 +1300
        Re: Help with some python homework... Chris Angelico <rosuav@gmail.com> - 2014-01-31 19:30 +1100
          Re: Help with some python homework... Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-01-31 23:46 +1300
        Re: Help with some python homework... Chris Angelico <rosuav@gmail.com> - 2014-02-01 11:57 +1100
        Re: Help with some python homework... Chris Angelico <rosuav@gmail.com> - 2014-02-01 12:34 +1100
        Re: Help with some python homework... David <bouncingcats@gmail.com> - 2014-02-01 14:17 +1100
        Re: Help with some python homework... Scott W Dunning <swdunning@cox.net> - 2014-01-31 18:14 -0700
          Re: Help with some python homework... Denis McMahon <denismfmcmahon@gmail.com> - 2014-02-01 19:32 +0000
            Re: Help with some python homework... David Hutto <dwightdhutto@gmail.com> - 2014-02-02 17:12 -0800
              Re: Help with some python homework... Larry Hudson <orgnut@yahoo.com> - 2014-02-02 23:48 -0800
        Re: Help with some python homework... Scott W Dunning <swdunning@cox.net> - 2014-01-31 17:46 -0700
        Re: Help with some python homework... Scott W Dunning <swdunning@cox.net> - 2014-01-31 17:42 -0700
        Re: Help with some python homework... David <bouncingcats@gmail.com> - 2014-02-01 17:13 +1100
        Re: Help with some python homework... Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-02-01 10:44 -0500
  Re: Help with some python homework... Neil Cerutti <neilc@norwich.edu> - 2014-01-31 13:51 +0000
  Re: Help with some python homework... Denis McMahon <denismfmcmahon@gmail.com> - 2014-02-01 03:02 +0000
  Re: Help with some python homework... Scott W Dunning <swdunning@cox.net> - 2014-01-31 17:35 -0700
  Re: Help with some python homework... Scott W Dunning <swdunning@cox.net> - 2014-01-31 22:18 -0700
    Re: Help with some python homework... Denis McMahon <denismfmcmahon@gmail.com> - 2014-02-01 19:45 +0000
    Re: Help with some python homework... David Hutto <dwightdhutto@gmail.com> - 2014-02-02 08:11 -0800
      Re: Help with some python homework... David Hutto <dwightdhutto@gmail.com> - 2014-02-02 08:36 -0800
      Re: Help with some python homework... MRAB <python@mrabarnett.plus.com> - 2014-02-02 16:38 +0000
        Re: Help with some python homework... David Hutto <dwightdhutto@gmail.com> - 2014-02-02 08:57 -0800
          Re: Help with some python homework... Denis McMahon <denismfmcmahon@gmail.com> - 2014-02-02 17:43 +0000
            Re: Help with some python homework... David Hutto <dwightdhutto@gmail.com> - 2014-02-02 10:09 -0800
            Re: Help with some python homework... David Hutto <dwightdhutto@gmail.com> - 2014-02-02 11:08 -0800
              Re: Help with some python homework... David Hutto <dwightdhutto@gmail.com> - 2014-02-02 11:21 -0800
    Re: Help with some python homework... "Rhodri James" <rhodri@wildebst.org.uk> - 2014-02-02 17:15 +0000
  Re: Help with some python homework... Scott W Dunning <swdunning@cox.net> - 2014-01-31 22:04 -0700
  Re: Help with some python homework... Scott W Dunning <swdunning@cox.net> - 2014-01-31 17:07 -0700
  Re: Help with some python homework... Scott W Dunning <swdunning@cox.net> - 2014-01-31 22:19 -0700
  Re: Help with some python homework... Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-02-01 10:50 -0500
  Re: Help with some python homework... Scott W Dunning <swdunning@cox.net> - 2014-02-01 23:06 -0700

csiph-web