与字符串一起使用时,星号(*)被定义为重复运算符。它将给定的字符串与数字连接的次数最多,其后跟星号。
>>> string = 'abcdefghij' >>> print (string*2) abcdefghijabcdefghij