Home > Article > Backend Development > Python variable length parameters
I feel that Python’s variable-length parameters are quite easy to use. Record them for easy query.
def selectsql(self, sqlstr, *condition):
arr = sqlstr.split("?")
for i in range (len(arr)-1):
rs += arr[i] + str(condition[i])
using using using using using using using using through using ’ s ’ s ‐ ‐ ‐ ‐ sele(self, sqlstr, **condition): print(key,condition[key])