:``%r`` 用作 debug,``%s`` 用作显示。
print ("How old are you?",)
age = input()
print ("How tall are you?",)
height = input()
print("how much do you weigh?",)
weight = input()
print ("So, you're %r old, %r tall and %r heacy."
% (age, height, weight))
# 打印出来后我的字符串前面有个 u ,像 u'35' 这样。
# 它表示 Python 告诉你你的字符串是 unicode。使用 %s 就一切正常了
转载请注明原文地址: https://ju.6miu.com/read-668915.html