Generate string of numbers python

前端 未结 2 802
误落风尘
误落风尘 2020-12-11 16:51

Hello I want to create a list of strings where each string is a number.

Fox example given the number 4 I would like to create a function that returns a list with ele

2条回答
  •  Happy的楠姐
    2020-12-11 17:42

    map being frowned upon by many python developers, here is the comprehension list equivalent:

     [str(x) for x in range(my_value + 1)]
    

提交回复
热议问题