Newbie question....

Robin Porter mogul at primus.ca
Wed Jun 7 17:45:12 EDT 2000


    How is it that you run code once you enter it?  I am using Python 1.5.2
in Win 9x.  After inputing the code in the Python GUI, and saving it, I have
been trying to run it by pressing F5 or pressing edit (top menu) and then
selecting RUN at the bottom.  Please tell me what I am doing wrong?
    Thank you so much for your help.

Robin

Here is the code:

TaxRate  = 0.23
MinPay   = 300.0
RegHours = 40.0

TaxPayable = 0
Overtime = 0
OvertimeHours = 0.0

HoursWorked = float(raw_input("Please enter the hours worked per week? "))
PayRate = float(raw_input("Please enter the rate of pay? "))

if HoursWorked > RegHours:
    OvertimeHours = HoursWorked - RegHours
    Overtime = (OvertimeHours) * (PayRate*1.5)

GrossPay = ((HoursWorked-OvertimeHours)*PayRate)+Overtime

if GrossPay > MinPay:
  TaxPayable = (GrossPay-MinPay)*TaxRate

NetPay = (GrossPay-TaxPayable);

print "The gross pay is %f" % GrossPay
print "The net pay is %f" % NetPay





More information about the Python-list mailing list