

python中字符串换行输出使用转义字符 或使用三引号实现:
使用转义字符 :
print("I'm Bob.
What's your name?")输出结果:
I'm Bob. What's your name?
使用三引号:
python三引号允许一个字符串跨多行,字符串中可以包含换行符、制表符以及其他特殊字符。
>>> hi = '''hi there''' >>> hi # repr() 'hi there' >>> print hi # str() hi there
更多Python相关技术文章,请访问Python教程栏目进行学习!
