title: How do I link the validation function to a receipt
body: <p>I need help with printing a receipt for my program, so basically, the user will enter their personal details into the program and I tried to make the validation perfect by using the functions below but the problem is that when I use those functions for validation, I don't know how to get the correct info from function to my receipt.</p>
  <pre><code>def date():
      inputDate = input(&quot;Enter the booking date in format 'dd/mm/yy' : &quot;)
  
      day, month, year = inputDate.split('/')
  
      isValidDate = True
      try:
          datetime.datetime(int(year), int(month), int(day))
      except ValueError:
          isValidDate = False
  
      if(isValidDate):
          print(&quot;Input date is valid ..&quot;)
      else:
          print(&quot;Input date is not valid..&quot;)
          date()
  
  
  def validateEmail(email):
      return re.match(r'[\w-]{1,20}@\w{2,20}\.\w{2,3}$', email)
  
  
  
  def checkemail():
      email = console.input('[bright_white]Please enter your email address: [/]')
      valid = validateEmail(email)
      if valid:
          print(email, 'is valid')
      else:
          print(&quot;invalid email format&quot;, email)
          checkemail()
  
  def phone():
      phoneno = console.input('[bright_white]Please enter your phone number :[/] ')
      patter = r&quot;^(1|8|9)[0-9]{7}&quot;
  
      if re.match(patter, phoneno) and len(phoneno) == 8:
          print(&quot;Valid&quot;)
      else:
          print(&quot;Invalid&quot;)
          phone()
  
  
  def booking_form():
  
      bookings = []
  
  
      FirstName = input('Please enter your first name: ')
      LastName = input('Please enter your last name: ')
      Email = checkemail()
      ContactNumber = phone()
      Date = date()
      Time = input('Enter time in 00:00 AM/PM format:')
      Gym = input(&quot;Please Enter the Name of the Gym Again to Ensure that to be the Correct one:  &quot;)
      Commentsrequest = input('Comments/Additional Request: ')
  
  
      bookings.append(FirstName)
      bookings.append(LastName)
      bookings.append(Email)
      bookings.append(ContactNumber)
      bookings.append(Date)
      bookings.append(Time)
      bookings.append(Gym)
      bookings.append(Commentsrequest)
  
  
      with open(&quot;booking.csv&quot;, 'a', newline='') as csvfile:
          writer = csv.writer(csvfile)
          writer.writerow(bookings)
  
  
      print(&quot; Date:&quot;, date())
      print(&quot; Time:&quot;, Time)
      print(&quot; First Name:&quot;, FirstName)
      print(&quot; Last Name:&quot;, LastName)
      print(&quot; Email:&quot;, validateEmail(email))
      print(&quot; Phone Number:&quot;, ContactNumber)
      print(&quot; Chosen Location [Area/Gym]:&quot;, Gym)
      print(&quot; Additional Notes/Requests:&quot;, Commentsrequest)
      print(&quot;**********************************************************************&quot;, )
      print(&quot;|         Thank You for Using the Volleyball Booking System          |&quot;, )
      print(&quot;|            You have Successfully Booked a Court/Gym                |&quot;, )
      print(&quot;|             Please Screenshot this Receipt to Keep                 |&quot;, )
      print(&quot;|                      as Proof of Booking                           |&quot;, )
      print(&quot;|          Have a Good Day, We will see you on the Court!!           |&quot;, )
      print(
          &quot;                          ★★★★★★★★★★★★                              &quot;)
      print(&quot;**********************************************************************&quot;, )
      exit()
  </code></pre>