我遇到了一个棘手的问题。
TypeError: ord() expected a character, but string of length 2 found
我的代码:
for c in input_s:
if ord('a') <= ord(c.lower()) <= ord('z'):
e_count += 1
我期望for c in input_s
,即string
和c
always字符被赋值。这种情况很少发生,因此很难重新生成问题。是否存在c
变量包含length2字符串的情况?
转载请注明出处:http://www.sthongjia.com/article/20230526/1401440.html