본문 바로가기
Python 배우기

string_methods.py

by 노화방지 Anti-aging Hairstyle 2016. 3. 6.
반응형
monty_python = "Monty Python"
print(monty_python)

print(monty_python.lower()) # print lower-cased version of the string

print(monty_python.upper())

산출물 (Output)


Monty Python

monty python


MONTY PYTHON



*  유용한 string methods가 많이 있습니다.
   문자열을 전부 소문자로 만들려면 'lower()' method를 사용합니다.
   'upper()' method는 문자열을 대문자로 만들 때 사용합니다.
   To call any string method, type a dot after the string (or a variable containing the string) 
and the method name after it, e.g. "John".upper().
In PyCharm, you can explore all available string methods by using Ctrl+Space after a dot.


반응형

'Python 배우기' 카테고리의 다른 글

list_operations.py  (0) 2016.03.07
lists.py  (0) 2016.03.06
character_escaping.py  (0) 2016.03.06
len_function.py  (0) 2016.03.06
in_operator.py  (0) 2016.03.06

댓글