字符串重复

基本类型 / 字符串

str_v = "7" * 3
# str_v is '777'

# Any string repeats, not only one char
laugh = "ha" * 3
# laugh is 'hahaha'

# Zero or negative count: empty, no error
empty = "7" * -1
# empty is ''

print(f"{str_v = }")
print(f"{laugh = }")
print(f"{empty = }")