Is it possible to make a letter range in python?

前端 未结 8 1643
误落风尘
误落风尘 2021-01-02 17:23

Is there a way to do a letter range in python like this:

for x in range(a,h,)
8条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-02 18:10

    this is easier for me at least to read/understand (and you can easily customize which letters are included, and in what order):

    letters = 'abcdefghijklmnopqrstuvwxyz'
    for each in letters:
        print each
    
    result:
    a
    b
    c
    ...
    z
    

提交回复
热议问题