How do you make a string repeat itself in python

前端 未结 2 1191
孤城傲影
孤城傲影 2021-01-26 03:23

How do I make a string repeat itself for example:

instead of writing print (\'---------------------------\') how do I make it something like print (\'

2条回答
  •  悲&欢浪女
    2021-01-26 04:08

    You were so close:

    >>> print('-' * 60)
    ------------------------------------------------------------
    

    You need to multiply the str value, not the return value of the print() function.

提交回复
热议问题