I'm doing some testing and the code seems to be correct logically, but when I use an example: "What day is today?" as self.frase it only returns me the first if (of the hours) if I put it as self.frase="What day of the week is it today?" the same error happens, where am I going wrong?
def about_time(self):
temp_atual = datetime.datetime.now()
if 'são' or 'sao' in self.frase:
print("Agora são " + str(temp_atual.hour) + " horas, " + str(temp_atual.minute) + " minutos e " + str(temp_atual.second) + " segundos.")
elif 'dia' and 'hoje' in self.frase:
print("Hoje é dia " + str(temp_atual.day) + "/" + str(temp_atual.month) + "/" + str(temp_atual.year))
elif 'dia da semana' in self.frase:
dia = temp_atual.isoweekday()
if dia == 1:
dia = "segunda-feira"
if dia == 2:
dia = "terça-feira"
if dia == 3:
dia = "quarta-feira"
if dia == 4:
dia = "quinta-feira"
if dia == 5:
dia = "sexta-feira"
if dia == 6:
dia = "sábado"
if dia == 7:
dia = "domingo"
print("Hoje é " + dia)