Python学习笔记(二):字符串的运算

1.字符串的相加 "hello"+"world" = "hello world" 2.字符串的乘法 "hello"*3 = "hellohellohello"(即hello重复显示3遍) 注:字符串不能与字符串相乘,只用于和数字相乘,如: print("hello"*"world") 运行报错:     print("hello" * "world") TypeError: can't multi
相关文章
相关标签/搜索