![](/img/trans.png)
[英]How can i compare two lists of words, change the words that are in common, and print the result in python?
[英]How can I join two words in python?
user = input('Create a Username: ')
passw = input('Create a Password: ')
f = open("users.txt", "a")
combine = "|".join("\n" + user + passw)
f.write(combine)
f.close()
我创建了一个变量,我可以在其中组合用户名和密码并将其写入 users.txt 文件。但是当我尝试组合“admin”和“99”时,它是这样的: a|d|m|i|n|9|9|
.
做简单的旧连接:
user = input('Create a Username: ')
passw = input('Create a Password: ')
f = open("users.txt", "a")
combine = user + "|" + passw
f.write(combine)
f.close()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.