[Tutor] My program gives no output (was (no subject)

bob gailer bgailer at gmail.com
Sat Nov 12 05:12:11 CET 2011


Welcome to the Tutor list.

Please provide a meaningful subbject as we track posts by subject

On 11/11/2011 4:40 PM, Nic Jaworski 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.

IMHO you cannot get nothing. You should either get some error message or 
at least "how many days for your salary?"

Exactly what do you do to run the program?

>
> #Nic  11/5/2011
> #Penny +=1 Each Day
>
> from math import *
> from numberTest import *
> from clearPause import *
> from locale import *

I highly recommend not using from...  import *
Instead import ... and qualify the imported items.

I am not familiar with numberTest or clearPause.
Where did you find them?

> #=============================================Main
>
>
> def main():
>     days=indays()
>     salary = calc(days)
> #=========================== Days input
> def 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()
>
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor


-- 
Bob Gailer
919-636-4239
Chapel Hill NC

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20111111/2952e889/attachment.html>


More information about the Tutor mailing list