如何在 python 的文本字符串中同时包含引号和双引号?
python 346
原文标题 :How can I include both quotes and double quotes in a text string in python?
我正在尝试自动化一个包含引号 ” 和 ‘ 的 Minecraft 命令。当我连接字符串变量时,它们会使开始和结束字符串的引号弄得一团糟。有没有办法避免这种情况?
Name = input("User name: ")
Age = input("User age: ")
Sex = input("User gender: ")
Job = input("User job: ")
Final = '/give @s flower_banner_pattern{display:{Lore:['{"text":"Name: " + Name + ","color":"white"}','{"text":"Age: " + Age + ','color":"white"}','{"text":"Sex: " + Sex + ","color":"white"}','{"text":"Job: " + Job + ','color":"white"}']}}'
你有什么想法?谢谢您的帮助!
[对不起我的英语我是意大利人]