I need to connect a variable to a search condition where I am looking to retrieve specific details from a table:

```
purchase = input("Please enter your Transaction ID(Found in the format - Letter-Number-Letter-Letter-Number, like A9BH1): ")

```

Here, I need 'Purchase' as the condition in

```
  sql = "select * from 4wps where T_ID = "
  cursor.execute(sql)
  result = cursor.fetchall()

```

I do not know how to enter 'purchase' into the above sample after 'T\_ID ='. I have followed a friend's code, but he apparently copied it from somewhere.

I am in 12th in India, CBSE, and this is for a project, and therefore I cannot use anything advanced.