我在询问用户的身体属性(头发颜色,眼睛颜色等)。语音标记中的打印变量
chooseCharacter = input("What character do you want to use? (%s or %s): " % (charOne, charTwo))
if chooseCharacter=="%s" % charOne:
attributes=[]
hair= input("what colour hair does %s have?" % (charOne))
build= input("what build is %s?" % (charOne))
eyes= input("what colour eyes does %s have?" % (charOne))
weaponOfChoice= input("what weapon is %s using?" % (charOne))
defence= input("what defence does %s use?" % (charOne))
("%s")=('hello %s. Am i right to say you have',hair,'right?. You should also be',build,'and have',eyes,'eyes.' % charOne)
如何打印出说明?
你好(charOne)我是正确的说你(定义)的头发,(定义) 眼睛
当你说“这是行不通的”,你得到了什么错误? – fixxxer
如果您在运行时包含了当前正在获得的确切输出,将会有帮助 – OverloadUT
要进行打印,请使用'print'。不奇怪'(“%s”)='。 –