def input_time(target_list): target_list.append( Time( int(input("Введите часы: ")), int(input("Введите минуты: ")), int(input("Введите секунды: ")), ))
def __init__(self, name, hours=None, mins=None, seconds=None): self.name = name self.capacity = 16 self.location = 'HUB' self.loaded_package_list = [] # Truck will start loading and delivery at a custom time if the optional parameters are given. If no optional # parameters are given then the truck starts at the start time of 8AM. # Time Complexity O(1), Space Complexity O(1) if hours is not None and mins is not None and seconds is not None: today = date.today() truck_start_time = datetime(today.year, today.month, today.day, hours, mins, seconds) self.time = Time(truck_start_time) else: global early_trucks early_trucks += 1 self.time = Time()
def populate_times(target_list): target_list.append(Time(12, 6, 3)) target_list.append(Time(23, 59, 55)) target_list.append(Time(8, 30, 0))
from time_class import Time import asyncio time1 = Time('Barcelona', ['Messi','Frenkie','Marc-Andre','Dani Morer', 'Jorge Cuenca'],'Ronald Koeman') time2 = Time('Real Madrid', ['Cristiano Ronaldo','Diego Altube','Marcelo','Nacho', 'Mariano'],'Zinédine Zidane') ganhador = asyncio.run(time1.jogar(time2)) if ganhador == time1.nomeTime: print("Melhor jogador da partida:") time1.premiarJogador() elif ganhador == time2.nomeTime: print("Melhor jogador da partida:") time2.premiarJogador() else: print("Melhores jogadores da partida:") time1.premiarJogador() time2.premiarJogador()
from time_class import Time tm = Time() tm.print_me()