20121016python学习笔记
1.格式输出也可以 是变量
1 a = “%r %s” 2 print a % (5, "baidu") 3 输出结果:5 baidu
2.%r对字符串的输出结果不做转意
1 print "%r" % "\tabc" 2 输出结果:'\tabc' 3 print "%s" % "\tabc" 4 输出结果: abc
3.三引号的完整输出
1 print """ 2 Hello! 3 Can I help you? 4 \nNo! Thanks! 5 """ 6 输出结果: 7 Hello! 8 Can I help you? 9 10 No! Thanks!

浙公网安备 33010602011771号