日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

python计算工资工时_Python帮助-工时卡脚本/工资计算

發布時間:2024/1/1 python 38 豆豆
生活随笔 收集整理的這篇文章主要介紹了 python计算工资工时_Python帮助-工时卡脚本/工资计算 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

感謝您的答復,我嘗試了軍用時間,但我堅持如何獲取python以計算兩次之間的正確分鐘數。

在這里,我將發布到目前為止的代碼。問題是它無法計算正確工作的實際分鐘數的最終值:

def main():

from math import *

from string import *

print "This program calculates the wage earned based on the number of hours worked.\n"

startTime = raw_input("Enter the start time in hours:min format: ")

endTime = raw_input("Enter the end time in hours:min format: ")

#splits time input into usable chunks

startSplit = split(startTime,":")

endSplit = split(endTime,":")

#converts strings to usable integers

startHrs = int(startSplit[0])

startMin = int(startSplit[1])

endHrs = int(endSplit[0])

endMin = int(endSplit[1])

#self explanatory...

startTimeConvert = ((startHrs+12)*100)+startMin

print "The start time conversion is ",startTimeConvert

endTimeConvert = ((endHrs+12)*100)+endMin

print "The end time conversion is ",endTimeConvert

totalTime = endTimeConvert - startTimeConvert

print "Total time is: ",totalTime

#use "0"+str if time is only 3 digits

totalHrs = "0"+str(totalTime)[0:1]

totalMin = "0"+str(totalTime)[2:3]

print "totalHrs test: ",totalHrs

print "totalMin test: ",totalMin

#hourly rate earned

wage = (int(totalHrs)*12.55)+((int(totalMin)*12.55)/60)

#divided min by 60 to get correct wage for minutes portion

print "Wage test: $",wage

if __name__ == '__main__':

main()

我打算將所有內容分成單獨的函數以簡化腳本,但是稍后會出現……在它真正正常工作之后。

任何人都有如何完成代碼并使代碼正確運行的想法嗎?

總結

以上是生活随笔為你收集整理的python计算工资工时_Python帮助-工时卡脚本/工资计算的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。