I have the following:
x = ['dat1','dat2']
y = ['M','F']
for x,y in zip(x,y):
conn.execute('''
create table %s as
select sex as sex
from raw
where sex in (?)
'''%(x),(y )
)
conn.commit()
How do set the for loop/list to capture both M and F strings along with M and F individually without resorting to joins? I've tried various lists such as this y = ['M','F','"M","F"'] but they don't work (I included 'dat3' in x as well). Is format() needed?
It can be done with the
LIKEoperator: