andreymal Asked:2020-08-31 19:20:50 +0000 UTC2020-08-31 19:20:50 +0000 UTC 2020-08-31 19:20:50 +0000 UTC 连接两个字符串并显示结果 772 假设我有两行: stroka1 = input() stroka2 = input() 输入数据: qwertyuiopasd fghjklzxcvbnm 如何将这些行合并(添加)为一条并输出? qwertyuiopasdfghjklzxcvbnm python 1 个回答 Voted Best Answer andreymal 2020-08-31T19:20:50Z2020-08-31T19:20:50Z 连接字符串的操作被巧妙地称为连接。+Python 使用(plus)运算符进行连接: s1 = 'qwertyuiopasd' s2 = 'fghjklzxcvbnm' print(s1 + s2) 结果: qwertyuiopasdfghjklzxcvbnm 您可以将结果放入变量中并已经输出: s1 = 'qwertyuiopasd' s2 = 'fghjklzxcvbnm' s3 = s1 + s2 print(s3)
连接字符串的操作被巧妙地称为连接。
+Python 使用(plus)运算符进行连接:结果:
您可以将结果放入变量中并已经输出: