isalpha()
๋ฌธ์์ด์ ๊ณต๋ฐฑ, ๊ธฐํธ, ์ซ์๊ฐ ์์์ False๋ฅผ ๋ฆฌํดํ๋ค.
# Example for isalpha
check1 = 'A'
check2 = 'S520'
check3 = 'ํญ์ํ๋ณตํ์'
check4 = 'happy_love'
check5 = 'happy love'
print(check1.isalpha()) # True
print(check2.isalpha()) # ์ซ์ ํฌํจ False
print(check3.isalpha()) # True
print(check4.isalpha()) # ๊ธฐํธ ํฌํจ False
print(check5.isalpha()) # ๊ณต๋ฐฑ ํฌํจ False
isdisit()
๋ฌธ์์ด์ ๊ณต๋ฐฑ, ๊ธฐํธ, ์ซ์๊ฐ ์์์ False๋ฅผ ๋ฆฌํดํ๋ค.
# Example for isdigit
check1 = '123'
check2 = '010-1234-1234'
check3 = '์ ํ010'
check4 = '010 1234 1234'
print(check1.isdigit()) # True
print(check2.isdigit()) # ๊ธฐํธ ํฌํจ False
print(check3.isdigit()) # ๋ฌธ์ ํฌํจ False
print(check4.isdigit()) # ๊ณต๋ฐฑ ํฌํจ False
# Example for isalnum
check1 = '1234'
check2 = 'happy'
check3 = 'happy1234'
check4 = 'happy_1234'
check5 = 'happy 1234'
print(check1.isalnum()) # True
print(check2.isalnum()) # True
print(check3.isalnum()) # True
print(check4.isalnum()) # ๊ธฐํธ ํฌํจ False
print(check5.isalnum()) # ๊ณต๋ฐฑ ํฌํจ False