I'm a Software Development student, and currently stuck on validating a date format with Python. I'm currently learning validations and can't really find anything that quite answers the question for what I want to do.
This is the code I want to verify:
InvDateStr = input("Enter the invoice date (YYYY-MM-DD): ")
InvDate = datetime.datetime.strptime(InvDateStr, "%Y-%m-%d")
if InvDate == "":
print("Invoice date cannot be blank. Please re-enter.")
else:
break
Thanks in advance!