Is there is a way to make sure that the user enters the input data as I want them to, For example, I wrote this code so the user can enter some birthdays and the script will choose one in random:
import random, re
print("keep in mind that you need to enter the date in this format dd/mm/yyyy")
cont_1 = input("please enter the informations of the 1st contestant : \n")
cont_2 = input("please enter the informations of the 2nd contestant : \n")
cont_3 = input("please enter the informations of the 3rd contestant : \n")
cont_4 = input("please enter the informations of the 4th contestant : \n")
cont_5 = input("please enter the informations of the 5th contestant : \n")
print("Thank you,")
win = cont_1 + " " + cont_2 + " " + cont_3 + " " + cont_4 + " " + cont_5
contDates = re.compile(r'\d\d/\d\d/\d\d\d\d')
ir = contDates.findall(win)
print(" And the Winner is: ", random.choice(ir))
I want to know if there is a way to force the user to write in the input in this format ../../... when he enters the first two digits a slash shows and the next two