Newbee Question

kyosohma at gmail.com kyosohma at gmail.com
Mon Aug 20 16:51:10 CEST 2007


On Aug 20, 9:23 am, "HD1956" <hd7... at hotmail.com> wrote:
> This is probably a simple code. I am a truck driver who gets paid by
> stops and cases. I am trying to figure out how to code my stop pay. I
> get 40 cents per stop up to 22 stops, and $1.40 per stops after that.

def calc(num):
	if num < 23:
		return 0.4 * num
	else:
		overtime = num - 22
		x = 0.4 * 22
		x += overtime * 1.4
		return x

# Use your own brain next time

Mike




More information about the Python-list mailing list