我想编写一个代码,可以在列中搜索只有几个字母的字母

时间:2017-04-22 09:54:08

标签: python-2.7 sqlite

我创建了一个包含列(名称,地址)的表我想编写一个代码使循环成行并搜索所有包含(a,s)的名称,我这样做

Cur.execute('SELECT names FROM members')
for row in cur:
    if (names contain e,s "the missing code")
    print row

1 个答案:

答案 0 :(得分:0)

如果可能,我想要确定搜索字母的用户

Cur.execute('SELECT names FROM members')
for row in cur:
    search = raw_input(" Enter any letters of names you want to 
    search here ")
    if (names contain search "the missing code")
print row