string
-
[Python tutorial] 20. String methods코딩/Python 2022. 12. 21. 17:18
string.capitalize() Converts the first character to upper case txt = "hello, and welcome to my world." x = txt.capitalize() print (x) string.casefold() Converts string into lower case txt = "Hello, And Welcome To My World!" x = txt.casefold() print(x) string.center(length, character) Returns a centered string txt = "banana" x = txt.center(20) print(x) string.count(value, start, end) Returns the ..
-
[Python tutorial] 5. Data type - Strings코딩/Python 2022. 12. 21. 17:11
Strings Assign String to a Variable a = "Hello" 파이썬 문자열은 변경 불가 a = 'Python' a[0] = 'J' # error Multiline Strings a = """Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.""" b = '''Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.''' # """string""", '..