title: Write a Python program to generate tickets for online bus booking, based on the class diagram given below
body: <ul>
  <li>Initialize static variable counter to 0</li>
  <li><code>validate_source_destination()</code>: Validate source and destination. source must always be Delhi and destination can be either Mumbai, Chennai, Pune or Kolkata. If both are valid, return true. Else return false</li>
  <li><code>generate_ticket()</code>:Validate source and destination. If valid, generate ticket id and assign it to attribute <code>ticket_id</code>. Ticket id should be generated with the first letter of source followed by first letter of destination and an auto-generated value starting from 01 (Ex: DM01, DP02,.. ,DK10,DC11). Else, set ticket_id as None.</li>
  <li>Note: Perform case insensitive string comparison</li>
  </ul>
  
  <p>For testing:</p>
  
  <ul>
  <li>Create objects of Ticket class</li>
  <li>Invoke <code>generate_ticket()</code> method on Ticket object</li>
  <li>Display ticket id, passenger name, source, destination</li>
  <li>In case of error/invalid data, display appropriate error message</li>
  </ul>
  
  <pre class="lang-py prettyprint-override"><code>class Ticket:
      counter=0 
      def __init__(self,passenger_name,source,destination):
          self.__passenger_name=passenger_name
          self.__source=source
          self.__destination=destination
          self.Counter=Ticket.counter
          Ticket.counter+=1
      def validate_source_destination(self):
          if (self.__source=="Delhi" and (self.__destination=="Pune" or self.__destination=="Mumbai" or self.__destination=="Chennai" or self.__destination=="Kolkata")):
              return True
          else:
              return False
  
      def generate_ticket(self ):
          if True:
              __ticket_id=self.__source[0]+self.__destination[0]+"0"+str(self.Counter)
              print( "Ticket id will be:",__ticket_id)
          else:
              return False
      def get_ticket_id(self):
          return self.ticket_id
      def get_passenger_name(self):
          return self.__passenger_name
      def get_source(self):
          if self.__source=="Delhi":
              return self.__source
          else:
              print("you have written invalid soure option")
              return None
      def get_destination(self):
          if self.__destination=="Pune":
              return self.__destination
          elif self.__destination=="Mumbai":
              return self.__destination
          elif self.__destination=="Chennai":
              return self.__destination
          elif self.__destination=="Kolkata":
              return self.__destination
  
          else:
              return None
  </code></pre>
  
  <p>when <code>generate_ticket()</code> method will give false condition I don't want to print <code>ticket_id</code> but in my code after the false statement the ticket id does print output.</p>