Page 2 of 2 First 12
  • Jump to page:
    #16
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    55
    Rep Power
    2
    Originally Posted by b49P23TIvg
    Code:
    printNow = print
    def myweeklyPay(hoursPerWeek, state = []):
        if not state:
            print("\t\t\tPay Rate: Dollars per Hour\n\t\t12\t13\t14\t15\t16\t17\t18\t19\t20\n ======================================================================")
            state.append('done')
        for i in range(1):
            print("%d %s \t%d \t%d \t%d \t%d \t%d \t%d \t%d \t%d \t%d " % (hoursPerWeek, "hrs/wk:", hoursPerWeek*12, hoursPerWeek*13, hoursPerWeek*14, hoursPerWeek*15, hoursPerWeek*16, hoursPerWeek*17, hoursPerWeek*18, hoursPerWeek*19, hoursPerWeek*20))
    Thanks so much, now it works like i want it to ,

    Code:
    def myweeklyPay(hoursPerWeek, state = []):
        if not state:
          mylist=["\t\t\tPay Rate: Dollars per Hour""\n\t\t12" + "\t13" + "\t14" + "\t15" + "\t16" + "\t17" + "\t18" + "\t19" + "\t20""\n ======================================================================"]
          for i in mylist:
            printNow(i)
            state.append('done')
           
        for i in range(1):
            printNow("%d %s \t%d \t%d \t%d \t%d \t%d \t%d \t%d \t%d \t%d  " % (hoursPerWeek, "hrs/wk:", hoursPerWeek*12, hoursPerWeek*13, hoursPerWeek*14, hoursPerWeek*15, hoursPerWeek*16, hoursPerWeek*17, hoursPerWeek*18, hoursPerWeek*19, hoursPerWeek*20))
  2. #17
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,843
    Rep Power
    480
    But you will get a low score for explicitly writing out
    Code:
     hoursPerWeek*12, hoursPerWeek*13, hoursPerWeek*14, hoursPerWeek*15, hoursPerWeek*16, hoursPerWeek*17, hoursPerWeek*18, hoursPerWeek*19, hoursPerWeek*20))
    instead of putting it into a loop.
    [code]Code tags[/code] are essential for python code and Makefiles!
  4. #18
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    55
    Rep Power
    2
    Originally Posted by b49P23TIvg
    But you will get a low score for explicitly writing out
    Code:
     hoursPerWeek*12, hoursPerWeek*13, hoursPerWeek*14, hoursPerWeek*15, hoursPerWeek*16, hoursPerWeek*17, hoursPerWeek*18, hoursPerWeek*19, hoursPerWeek*20))
    instead of putting it into a loop.
    yh true, how can i do it in a for loop?
Page 2 of 2 First 12
  • Jump to page:

IMN logo majestic logo spyfu logo threadwatch logo seochat tools logo