Boolean string methods
Boolean 구문은 몇 가지 기능이 있다.
1) .isalpha() : 어떤 구문이 알파벳 으로 구성 되어 있으면 True
print("Python".isalpha()) >> True
2) .isalnum(): 어떤 구문이 알파벳과 숫자로 구성 되면 True
print(3rd".isalnum()) >> True
3) .startswith(): 어떤 구문이 정확한 지칭하는 문자 포함하면 True, (단 대,소문자 구분함)
print("Boolean".startswith("B")) >> True
4) .islower(): 소문자로만 구성 되었을 때 True
5) .isupper(): 대문자로만 구성 되었을 때 True
6) .istitle(): 첫글짜가 대문자로 되어 있을때 True
print("A Cold Stromy Night".istitle()) >> True
7) .isdigit(): 어떤 구문(" ")이 숫자로만 구성 되었을때 True
print("1003".isdigit()) >> True
'IT > Python' 카테고리의 다른 글
[파이썬] Casting/캐스팅 (0) | 2020.06.29 |
---|---|
[파이썬] if, elif, else 구문 (1) | 2020.06.29 |
[파이썬] Pandas Cheat Sheet (0) | 2020.06.17 |
[파이썬] Model Development (Residual Plot) (0) | 2020.06.16 |
[파이썬] Model Development (Linear Regression (선형 회귀)) (0) | 2020.06.16 |