python 中,支持相乘的有字符串,列表,元组,相乘是内容相乘 n ,新的内容会重复 n

str_a = "我"
print(str_a * 3)
list_a = ("1", "2", "3")
print(list_a * 3)
list_b = ["我", "爱", "python"]
print(list_b * 3)

运行结果为

更新于 阅读次数