>>> a = "hobby"
>>> a.count('b')
2
>>> a = "Python is the best choice"
>>> a.find('b')
14
>>> a.find('k')
-1
>>> a = "Life is too short"
>>> a.index('t')
8
>>> a.index('k')
Traceback (most recent call last):
File "<stdin>", line 1,in <module>
ValueError: substringnot found
>>> ",".join('abcd')
'a,b,c,d'
join 함수는 문자열뿐만 아니라 리스트나 튜플도 입력으로 사용할 수 있다.
>>> ",".join(['a', 'b', 'c', 'd'])
'a,b,c,d'
>>> a = "hi"
>>> a.upper()
'HI'
>>> a = "HI"
>>> a.lower()
'hi'
>>> a = " hi "
>>> a.lstrip()
'hi '
>>> a= " hi "
>>> a.rstrip()
' hi'