#main代码段
def main():
a = int(time.time())
total_second = int(a)
current_second = total_second % 60
total_minutes = total_second // 60
current_minute = total_minutes % 60
total_hours = total_minutes // 60
current_hour = total_hours % 24
b = exCode07.Time(current_hour,current_minute,current_second,55550505)
print(b.time_show())
print(b.get_time())
main()
我对这个结果没有信息
#class 类的代码段
class Time:
def __init__(self, hour=0, minute=0, second=0, elapse=0):
self.__hour = hour
self.__minute = minute
self.__second = second
self.__elapse = elapse
def set_hour(self, hour):
return self.__hour
def set_minute(self, minute):
return self.__minute
def set_second(self, second):
return self.__second
def set_elapse(self, elapse):
return self.__elapse
def get_hour(self):
return self.__hour
def get_minute(self):
return self.__minute
def get_second(self):
return self.__second
def time_show(self):
a = self.__hour
b = self.__minute
c = self.__second
return f"Current time is {a+8}:{b}:{c}"
def get_time(self):
a = int(self.__elapse)
total_second = int(a)
current_second = total_second % 60
total_minutes = total_second // 60
current_minute = total_minutes % 60
total_hours = total_minutes // 60
current_hour = total_hours % 24
return f"{current_hour + self.__hour+8} : {current_minute+self.__minute} : {current_second+self.__second}"