[Tutor] (no subject)
joel.goldstick at gmail.com
Fri Nov 11 22:54:24 CET 2011
On Fri, Nov 11, 2011 at 4:40 PM, Nic Jaworski <bufsabres2007 at hotmail.com>wrote:
> python: v. 2.7.1
> Compiler: WING IDE
> OS: Windows 7
> I am attempting to use a loop to output a 2D array for days and amount of
> pennies. I have it set to loop to do a penny times the day then to double
> the the penny and add a day. (the whole a penny doubles each day
> problem). However when I run my program I don't get anything, no output.
> #Nic 11/5/2011
> #Penny +=1 Each Day
> from math import *
> from numberTest import *
> from clearPause import *
> from locale import *
> def main():
> salary = calc(days)
> #=========================== Days input
> def indays():
> while integer==0:
> salary = raw_input("how many days for your salary? ")
> if integer ==0:
> print 'the entry was not numeric - Please re-enter'
> elif salary < 0:
> print 'please enter a number greater then 0'
> integer =0
> return salary
> def calc(days):
You are setting n = 0, then you loop only if n > days, and it never is.
> while n>days:
> x = array ([d,n])
> print x
> Tutor maillist - Tutor at python.org
> To unsubscribe or change subscription options:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor