Python基础(2)
Python
六.字符串(string)和文本
%r %s %d
x = "There are %d types of people." % 10
print x
There are 10 types of people.
print "I said: %r." % x
I said: 'There are 10 types of people.'.
七.更多打印
print "." * 10 # what'd that do?
..........
end1 = "C"
end2 = "h"
end3 = "e"
end4 = "e"
end5 = "s"
end6 = "e"
print end1 + end2 + end3 + end4 + end5 + end6
八.打印,打印
formatter = "%r %r %r %r"
print formatter % (1,2,3,4)
1,2,3,4
九. 打印,打印,打印
\ #换行
print """
内容
"""
内容 #输出
十.那是什么?