python exercise 11

来源:互联网 发布:网络安全法的基本特性 编辑:程序博客网 时间:2024/06/08 05:31

:``%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 就一切正常了

0 0
原创粉丝点击