Hi, how are you?
Why don't you simply use 'Ga' < c < 'He' when you look for Korean?
word = 'ABs%1C clear nifera$'
upper_counter = 0
lower_counter = 0
number_counter = 0
hangul_counter = 0
etc_counter = 0
for c in word:
if c.isupper():
upper_counter += 1
elif c.islower():
lower_counter += 1
elif c.isdigit():
number_counter += 1
elif 'Ga' < c< 'Hehe': # If you want to process consonants, compare 'a' <c< 'hh' like this
hangul_counter += 1
else:
etc_counter += 1
print(f'upper_counter: {upper_counter} lower_counter: {lower_counter} number_counter: {number_counter} hangul_counter: {hangul_counter} etc_counter: {etc_counter}')
Have a nice day
552 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
551 Who developed the "avformat-59.dll" that comes with FFmpeg?
549 Uncaught (inpromise) Error on Electron: An object could not be cloned
760 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
© 2024 OneMinuteCode. All rights reserved.