# ベース例文
sentences = 'こんにちは、お元気ですか?'
print(sentences)
#文章の始まりが合致
startWith = sentences.startswith('こんにちは')
print(startWith)
#特定の言葉の場所の位置を返す(頭から) 後ろからは .rfind
print(sentences.find('お元気'))
#特定の言葉が何個入っているか
print(sentences.count('元気'))
#文字を置換する
print(sentences.replace('こんにちは','こんばんは'))
#文章最初の文字を大文字にする
s = 'yes sir'
print(s.capitalize())
#各単語の一文字目を大文字にする
print(s.title())
#すべて大文字にする
print(s.upper())
#すべて小文字にする
print(s.lower())
# ベース例文
sentences = 'こんにちは、お元気ですか?'
print(sentences)
#文章の始まりが合致
startWith = sentences.startswith('こんにちは')
print(startWith)
#特定の言葉の場所の位置を返す(頭から) 後ろからは .rfind
print(sentences.find('お元気'))
#特定の言葉が何個入っているか
print(sentences.count('元気'))
#文字を置換する
print(sentences.replace('こんにちは','こんばんは'))
#文章最初の文字を大文字にする
s = 'yes sir'
print(s.capitalize())
#各単語の一文字目を大文字にする
print(s.title())
#すべて大文字にする
print(s.upper())
#すべて小文字にする
print(s.lower())
# ベース例文 sentences = 'こんにちは、お元気ですか?' print(sentences) #文章の始まりが合致 startWith = sentences.startswith('こんにちは') print(startWith) #特定の言葉の場所の位置を返す(頭から) 後ろからは .rfind print(sentences.find('お元気')) #特定の言葉が何個入っているか print(sentences.count('元気')) #文字を置換する print(sentences.replace('こんにちは','こんばんは')) #文章最初の文字を大文字にする s = 'yes sir' print(s.capitalize()) #各単語の一文字目を大文字にする print(s.title()) #すべて大文字にする print(s.upper()) #すべて小文字にする print(s.lower())