# Python 字符串 使用字符串,几种不同引号的混合使用,请选出下列字符串使用错误的代码。 ## template ```python def test(): print("双引号字符串") print('单引号字符串') print("双引号字符串里的单引号: 'hello world!'") print('单引号字符串里的双引号: "hello world!"') triple = ''' 三引号字符串 ''' print(triple) triple2 = ''' 三引号字符串的便利: * "双引号" * '单引号' ''' print(triple2) print("字符串加法"+"字符串加法") print("字符串乘法"*3) print(",".join(["字符串数组的聚合", "字符串数组的聚合", "字符串数组的聚合"])) if __name__ == '__main__': test() ``` ## 答案 ```python print("双引号字符串里的双引号: "hello world!"") print('单引号字符串里的单引号: 'hello world!'') triple2 = ''' 三引号字符串里的三引号: * "双引号" * '单引号' * '''三引号''' ''' ``` ## 选项 ### A ```python print("双引号字符串") print('单引号字符串') triple = ''' 三引号字符串 ''' ``` ### B ```python print("双引号字符串里的单引号: 'hello world!'") print('单引号字符串里的双引号: "hello world!"') ``` ### C ```python print("字符串加法"+"字符串加法") print("字符串乘法"*3) print(",".join(["字符串数组的聚合", "字符串数组的聚合", "字符串数组的聚合"])) ```