I have a code asks the user to input a date:
date_entry = input('Inserisci la data di fine mese del lancio del MAI in formato DD-MM-YYYY: ')
year, month, day = map(int, date_entry.split('-'))
date1 = pd.to_datetime(pd.Series(datetime.date(day, month, year)))
then I have to check if that date is a business end of month, if yes the code continues if not it exists. I tried this:
if date1 == BMonthEnd():
pass
else:
print("Ricontrolla: " + str(date1) + " non è un fine mese")
exit(0)
here I get the error as if I input 29-05-2020 the code exit even if this date is a business end of month (its a friday). Thanks. Luigi