# ### 字符串的相关操作 # (1)字符串的拼接 + strvar1 = "我爱你," strvar2 = "亲爱的菇凉" res = strvar1 + strvar2 print(res) # (2)字符串的重复 * strvar1 = "重要的事情说三遍" res = strvar1 * 3 print(res) # (3)字符串跨行拼接 str1 = "sdfsssssssssssssssssssssssssssssssssssssssssssss" "sssdsfsdfasdf" "你说的手" print(str1) # (4)字符串的索引 # 0 1 2 3 4 5 strvar = "道路一片光明" # -6-5 -4-3-2-1 res = strvar[4] print(res) res = strvar[-2] print(res)