NameError: name 'p' is not defined in

前端 未结 3 555
猫巷女王i
猫巷女王i 2021-01-29 01:52

This code executes, however, an error message \" NameError: name \'p\' is not defined in lines 7 and 11 - I tried adding float( ) around everything - same error - any ideas ???

3条回答
  •  不知归路
    2021-01-29 02:19

    Well, it is not defined in the function, is it?

    There's no statement telling that:

    p = ...
    

    Perhaps you mean to assign p to "(40 * rate + (hrs-40)*rate*1.5)" if hrs > 40, and not only print it?

提交回复
热议问题