Python에 대해 학습하면서 잘 쓰지않았던 좀 쌈빡한 method에 대해 잊어버리지 않게 정리하고자 posing을 작성한다.
Question = 'Is this alphabet upper case?'
Question_upper = Question.upper()
print(Question.isupper()) # False
print(Question_upper.isupper()) # True
Question = 'Is this alphabet upper case?'
Question_lower = Question.lower()
print(Question.islower()) # False
print(Question_upper.islower()) # True
alphabet_A = 'A'
alphabet_Z = 'Z'
print(ord(alphabet_A)) # 65
print(ord(alphabet_Z)) # 90
print(chr(66)) # B
print(chr(97)) # a
print(all([5])) # True
print(all([0])) # False_0은 False 이므로
print(all(5>x for x in range(3))) # True_generator는 iterable 속성을 가지고 있고 내부가 참이므로
print(all(x>5 for x in range(3))) # False_generator는 iterable 속성을 가지고 있으나 내부가 다 참이 아니므로
print(any([5,0])) # True
print(all([0,0])) # False_0은 False 이므로
print(all(x>1 for x in range(3))) # True_generator는 iterable 속성을 가지고 있고 내부에서 2가 조건을 만족하므로
print(all(x>5 for x in range(3))) # False_generator는 iterable 속성을 가지고 있으나 내부의 모두가 참이 아니므로
📖 출처 :
이번 posting에서는 python으로 coding을 하며 잘 쓰지는 않았으나 새로 알게된 method와 내장 함수에 대해 정리해 보았다. 이러한 method와 내장 함수 들을 잘 정리해 놓아야 겠다.