Home  >  Article  >  Backend Development  >  Python variable length parameters

Python variable length parameters

巴扎黑
巴扎黑Original
2016-12-08 09:20:411243browse

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])

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:python-send emailNext article:python-send email