I have tried to use the datetime code but i really don't understand it very much. I have managed to allow the user to input a date but i am not quite sure how to compare the dates. Here is what i have so far.
from datetime import datetime
now = datetime.now()
import re
validDate = False
while not validDate:
cdate = input("please enter your card expiration date: ")
if (re.match("^([0-9]{2})/([0-9]{2})/([0-9]{4})$", cdate)):
print("Valid")
validDate = True
else:
print("Error. Enter date in format dd/mm/yyyy")
I really have no clue how to compare the two please help me. if you have any suggestions for code that might be on this site please tell me. In the meantime i will keep trying to research.