[英]How do you check if a specific position is a letter character in python?
I know that in order to see if a variable has only letters you use .isalpha, but what if I'm trying to see if a specific position in the string is a letter? 我知道,为了查看变量是否只有字母,可以使用.isalpha,但是如果我尝试查看字符串中的特定位置是否为字母,该怎么办? How would I code that?
我该如何编码?
my_string[a_position].isalpha()
... ...
a character is just a string with one letter ... 一个字符只是一个字母组成的字符串...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.