Q:

How to define user input as dd/mm/yyyy and error handle input?

I am having trouble coding the user input variable DOB as a while loop and showing an error if the user does not input dob as dd/mm/yyyy
Any suggestions?
import datetime

while True :
    DOB = input('Date of Birth ')
    try :
        DOB = datetime.datetime.strptime(DOB, "%d//%m//%Y")
    except ValueError:
        print ('Error, Please try again')
    else:
        print("Error: must be format dd/mm/yyyy ")
        userkey = input("press 1 to try again or 0 to exit:")
        if userkey == "1":
            header()
        else:
            sys.exit

A:

There are a lot of errors here. So bear with me if I seem to be overwhelmingly negative.
DOB = datetime.datetime.strptime(week, "%d//%m//%Y")

is expecting the input string to be in week, but the input() call actually assigns it to DOB. So you will get NameError: name 'week' is not defined. And you have specified the date format with doubled slashes, %d//%m//%Y, as if the slashes needed to be escaped, but they don't, so you are asking the user to enter 12//02//2018 which no user is likely to guess, especially as your error prompt does not say this.
Next, you have try..except..else. This doesn't do what you seem to think it does. From the tutorial:

The try … except statement has an optional else clause, which, when present, must follow all except clauses. It is useful for code
  that must be executed if the try clause does not raise an exception.

In other words, even if the user does succeed in entering a "valid" date, double slashes and all, your code issues the message Error: must be format dd/mm/yyyy. 
After that, if the user makes an error and presses 1 to try again, your exception handler calls header(), which doesn't exist, and so the program will fail. And if the user presses 0 your exception handler attempts to call sys.exit(), but there is no import sys, so that will also get a NameError. And if even with import sys, it will still not do what you want, because you omitted the parens. Without them, you are naming the function, not calling it.
And lastly, you have a while True loop but you never exit from it, even if the user does enter a valid date.
With all of these things fixed up, the code looks like this:
import datetime
import sys

while True :
    DOB = input('Date of Birth ')
    try :
        DOB = datetime.datetime.strptime(DOB, "%d/%m/%Y")
        break
    except ValueError:
        print("Error: must be format dd/mm/yyyy ")
        userkey = input("press 1 to try again or 0 to exit:")
        if userkey == "0":
            sys.exit()

print (f"DOB is {DOB}")

