提示
- 字符串内有单引号’的,在输出时用双引号""括起来
- 字符串内有双引号"的,在输出时用单引号’'括起来
引号使用实例一
print("I'm a genius")
print('An old proverb says, "no pain, no gain."')
输出结果
I'm a genius
An old proverb says, "no pain, no gain."
引号使用实例二
print("麻烦的“引号”")
输出结果
麻烦的“引号”
结论
单引号和双引号都可以用来表示,一个字符串
字符串可以是符号,文字,数字,包裹在字符串中
的引号可以是中文符号,但外层的引号必须是英文的。