转义字符

#输出字符串
print('hello world')
print("换行:hello\nworld")#换行
print('水平制表符:  123456world')#水平制表符\t最大为4个字符长度
print('水平制表符:  \thello\tworld')
print('水平制表符:helloooo\tworld')
print('回车:hello\rworld')#回车
print('退格:hello\bworld')#退格

print('http:\\\\www.baidu.com')
print('老师说:\'大家好\'')
#原字符‘r',字符串中转义字符不起作用,Notes(最后一个字符不能是’\')
print(r"换行:hello\nworld")

alt

Python中的标识符和保留字

import keyword
print(keyword.kwlist)

['False', 'None', 'True', 'and', 'as', 'assert', 'async', 'await', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 'not', 'or', 'pass', 'raise', 'return', 'try', 'while', 'with', 'yield']