----- Original Message -----
From: RANDALL HOWELL <[EMAIL PROTECTED]>
Date: Monday, August 20, 2007 1:53 pm
Subject: [python-win32] Newbee question

> I am trying to figure out how to code my stop pay. I
> get paid 40 cents a stop for the first 22 stops, and
> $1.40 for stops after that. 
> stops = 24
> if stops < 22:
>    stopPay = stops * .4
> else: 
>    stopPay = stops * 1.4
> print stopPay
> >>> 33.6
> well thats not how I get paid, I get paid $8.80 for
> the first 22 stops + $2.80 for the last 2 stops. I
> know this is a elementary question, but it has got me
> stuck. Thanks

try initializing a pay accumulator variable (stopPay) and then executing
your if-else block
in a loop over stops in the range (1,25) where stopPay is incremented by
the rate
in effect for that stop.

P.S.
This question would be more appropriate for comp.lang.python since your
question is not specific to Microsoft Windows.

> _______________________________________________
> python-win32 mailing list
> python-win32@python.org
> http://mail.python.org/mailman/listinfo/python-win32
> 
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to