loom-benchmark-mbpp / 165 /solution /_reference.py
sqy201x's picture
Add files using upload-large-folder tool
6c62356 verified
Raw
History Blame Contribute Delete
229 Bytes
def count_char_position(str1):
count_chars = 0
for i in range(len(str1)):
if ((i == ord(str1[i]) - ord('A')) or
(i == ord(str1[i]) - ord('a'))):
count_chars += 1
return count_chars