python 字典的key和value取值

# list1 = ['xiaohei','xiaobai','xiaolan']
users = {'zhoujielun':'123456','liudehua':'abcdbf','dewdwe':'12wed'}
# for stu in users:
#     print('k==>',stu)
#     print('value==>',users[stu])
for key,value in users.items():
    print('%s => %s'%(key,value))#将key和value分离
    # sql='insert into user (username,password) value ("%s","%s");'%(stu,users[stu])
    #     # print(sql)

python 字典的key和value取值_第1张图片

你可能感兴趣的:(python)