Write a Python function to print whether the given Date is valid or not


Topic: Write a Python function to print whether the given Date is valid or not

Solution

def date_validator(d,m,y):
	import datetime 
	try:
		s=datetime.date(y,m,d)
		print("Date is valid.")
	except ValueError: 
		print("Date is invalid.")



List all Python Programs