Error :string indices must be integers

import pymysql

connection = pymysql.connect(host=‹ localhost ›, user=‹ 123 ›, passwd=‹ 987654 ›, db=‹ py_work ›)
cursor=connection.cursor()
rfid_data = ‹ 178,365,124,327 ›
sql=‹ select uid from table1 where uid =?; › [rfid_data]
cursor.execute(sql
countrow = cursor.execute(sql)
print(« Number of rows: »,countrow)
data = cursor.fetchall()
print(data)

https://openclassrooms.com/forum/sujet/typeerror-list-indices-must-be-integers-not-str-50151