现在学习阶段为:转义,闲着无聊研究各个字符的转义意思,现有如下发现(注:操作系统win10 1703,使用编辑器python idle3.6.3):
1、输入;print('i love studying\rpython')
输出:i love studyingpython
2、输入;print('i love studying\tpython')
输出:i love studying python
输入:print('i love studying \t python')
注:两边同时空格才有制表符的出现
输出:i love studying python
3、输入:print('i love studying\upython')
报错:SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 15-16: truncated \uXXXX escape
4、输入:print('i love studying\apython')注:b、v效果相同
输出:i love studying 口python
5、输入:print('i love studying\fpython')
i love studying (出现黑桃符号)python
6、输入:print('i love studying \x python')
报错:SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 15-16: truncated \xXX escape
7、输入:print('i love studying\npython')
输出:i love studying
python