[Tutor] (no subject)
Nic Jaworski
bufsabres2007 at hotmail.com
Fri Nov 11 22:40:31 CET 2011
python: v. 2.7.1Compiler: WING IDEOS: 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 *#=============================================Main
def main(): days=indays() salary = calc(days) #=========================== Days inputdef indays(): integer=0 while integer==0: salary = raw_input("how many days for your salary? ") integer,salary=testinteger(salary) if integer ==0: print 'the entry was not numeric - Please re-enter' pause() elif salary < 0: print 'please enter a number greater then 0' integer =0 else: integer=1 return salary
#=================================Calculation
def calc(days): n=0 d=1 while n>days: n+1 d**(n) d*2 x = array ([d,n]) print x main()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20111111/ac4beefe/attachment.html>
More information about the Tutor
mailing list