Newbee问题 [英] Newbee Question

查看:82
本文介绍了Newbee问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能是一个简单的代码。我是一名卡车司机,通过

止损和案件获得报酬。我想弄清楚如何编码我的停止工资。我支付
每次止损40美分,最多22次止损,之后每次止损1.40美元。

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.

推荐答案



8月20日上午9:23,HD1956 < hd7 ... @ hotmail.comwrote:
On Aug 20, 9:23 am, "HD1956" <hd7...@hotmail.comwrote:

这可能是一个简单的代码。我是一名卡车司机,通过

止损和案件获得报酬。我想弄清楚如何编码我的停止工资。我支付
每次止损40美分,最多22个止损,
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。
1.40 per stops after that.



def calc(num):

if num< 23:

返回0.4 *数字

否则:

超时=数字 - 22

x = 0.4 * 22

x + =加班费* 1.4

返回x


#下次使用自己的大脑


迈克

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


这篇关于Newbee问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆