【发布时间】:2014-07-17 12:01:10
【问题描述】:
所以我正在创建一类雇员,并且我想创建一个返回总工作时间的函数
试试 1、通过spyder运行这个 2. 在控制台中运行
给出不同的结果:S
class Employee(object):
def __init__(self, wage, wage1, hours_accounting=[]):
self.wage=wage
self.wage1=wage1
self.hours_accounting=hours_accounting
def work(self):
A=H,M=input('when did you start work today? format hh,mm')
B=H1,M1=input('when did you stop work today? format hh,mm')
total_time_in_hours=H1-H + (M1-M)/60
return total_time_in_hours
amanda=Employee(100, 50)
amanda.work()
07,15
21,00
#
为什么?提前致谢!
【问题讨论】: