title: Deleting a specific taxi booking that is stored in an SQLite 3 database with Python
body: <p>I am new to Python and for my first university assignment I have to make a taxi booking system, one of the features needs to be that the user can delete a previous booking.</p>
  <p>I have managed to get the selecting and listing of the bookings working but I cannot figure out how to delete one, here is what I have so far.</p>
  <pre><code>def cancel_booking(user_id):
      print(&quot;\n&quot;)
      print(&quot;Cancel a Booking&quot;)
      with sqlite3.connect('Database.db') as db:
          cursor = db.cursor()
  
      # bookings which belong to the current user
      sql = ''' SELECT * FROM booking WHERE customer_id=?'''
      cursor.execute(sql, (user_id,))
      bookings = cursor.fetchall()
  
      # Listing all the available bookings
      for i, b in enumerate(bookings, 1):
          print(str(i) + &quot;) &quot;&quot;Number: &quot;&quot;&quot; + str(b[3]) + &quot; Postcode: &quot;&quot;&quot; + str(b[4]),
                &quot;&quot;&quot; -&gt; Number: &quot;&quot;&quot; + str(b[5]) + &quot; Postcode: &quot;&quot;&quot; + str(b[6]))
  
      select_delete = input(&quot;Please select the number of the booking that you would like to delete:&quot;)
      index = int(select_delete)
      booking = bookings[index]
      bookingid = (booking[0],)
  
      delete_booking = &quot;&quot;&quot;DELETE FROM booking WHERE customer_id=?&quot;&quot;&quot;
      cursor.execute(delete_booking, user_id)
      db.commit()
  </code></pre>