Python Print parameter end

前端 未结 3 436
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-27 12:50

How to remove the last \"add -->\" from the output when using end, i am not using sep here, bcoz sep will not have any effect here , as the print statement prints just 1 item at

3条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-27 13:30

    The inevitable pythonic one-liner:

    print(*map(fibonaci_num, range(N)), sep=' add -> ')
    

提交回复
热议问题