How to check if a character is upper-case in Python?

前端 未结 7 705
挽巷
挽巷 2020-12-08 09:18

I have a string like this

>>> x=\"Alpha_beta_Gamma\"
>>> words = [y for y in x.split(\'_\')]
>>> words
[\'Alpha\', \'beta\', \'Gam         


        
7条回答
  •  孤街浪徒
    2020-12-08 09:45

    x="Alpha_beta_Gamma"
    is_uppercase_letter = True in map(lambda l: l.isupper(), x)
    print is_uppercase_letter
    >>>>True
    

    So you can write it in 1 string

提交回复
热议问题