Print multiline strings side-by-side

前端 未结 4 602
长情又很酷
长情又很酷 2020-12-20 06:42

I want to print the items from a list on the same line. The code I have tried:

dice_art = [\"\"\"
 -------
|       |
|   N   |
|       |
 ------- \"\"\",\"\"         


        
4条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-20 07:24

    A join command should do it.

    dice_art = ['ASCII0', 'ASCII1', 'ASCII2']
    print(" ".join(dice_art))
    

    The output would be:

    ASCII0 ASCII1 ASCII2
    

提交回复
热议问题