I have the date and time format inside the Script, but I see myself in the problem of not being able to include it. As I would in another situation, entering a value within the impression of the message. I have the code in two ways:
Form 1 :
import datetime
dt = datetime.datetime.now()
def tiempo():
if dt.time() < datetime.time(12):
print("dias")'
elif dt.time() > datetime.time(12):
print("tardes")
nombre = input("Por favor ingrese su nombre: ")
print("Buenas",tiempo(),nombre, "que duda tiene?: ")
In this first form it looks like this:
Please enter your name: Test Name
afternoons
Good None Test Name you have doubts ?:
Form 2 :
import datetime
dt = datetime.datetime.now()
tiempo = dt.time() < datetime.time(12), dt.time() > datetime.time(12)
if tiempo == True: print("dias")
elif tiempo == True: print("tardes")
nombre = input("Por favor ingrese su nombre: ")
print("Buenas", tiempo, nombre, "que duda tiene?: ")
In this second it looks like this:
Please enter your name: Test Name
Good (False, True) Test Name you have doubts ?: