我有2个变量
name='name1234'
age='21'
和一个neo4j密码查询
query33= 'CREATE (k:user { Username: @name, Userage: '@age' })'
我如何传递两个变量?
答案 0 :(得分:0)
您可以通过以下格式传递它:https://docs.python.org/3.4/library/functions.html#format
query33= "CREATE (k:user {{ Username: {name}, Userage: '{age}' }})".format(name='name1234', age=21)
query33
"CREATE (k:user { Username: name1234, Userage: '21' })"