(一)字符串连接
print("hello")其中"hello"是字符串
print("hello" + " world" +"!") 这里是字符串连接,运行出来为 hello world!
(二)单双引号转义
print("dad") 或print('dad'),代码可以运行
print("he said"good!"")这行代码就会出错哦,不能同时存在几对双引号或单引号,改为下面两种可以运行:
print('he said "good !" ')
(一)字符串连接
print("hello")其中"hello"是字符串
print("hello" + " world" +"!") 这里是字符串连接,运行出来为 hello world!
(二)单双引号转义
print("dad") 或print('dad'),代码可以运行
print("he said"good!"")这行代码就会出错哦,不能同时存在几对双引号或单引号,改为下面两种可以运行:
print('he said "good !" ')