方法1 单引号
name='du'
print(type(name))
print(name)
方法2 双引号
name="du"
print(type(name))
print(name)
方法3 三引号
name='''
du
'''
print(type(name))
print(name)
运行输出内容:
D:\untitled\venv\Scripts\python.exe D:/untitled/venv/Include/字符串.py
<class 'str'>
du
Process finished with exit code 0
原文:https://www.cnblogs.com/du-z/p/11011519.html