# .upper() はすべての文字を大文字にします
s = 'What happened to Anna?'
up = s.upper()
print('Hi 123 this is Sally!'.upper()) # HI 123 THIS IS SALLY!
print(s) # What happened to Anna?
print(s.upper()) # WHAT HAPPENED TO ANNA?
print(up) # WHAT HAPPENED TO ANNA?
# .lower() はすべての文字を小文字にします
s = 'What happened to Anna?'
low = s.lower()
print('Hi 123 this is Sally!'.lower()) # hi 123 this is sally!
print(s) # What happened to Anna?
print(s.lower()) # what happened to anna?
print(low) # what happened to anna?
# .title() はすべての単語の最初の文字を大文字にします(タイトルケース)
s = 'What happened to Anna?'
title = s.title()
print('Hi 123 this is Sally!'.title()) # Hi 123 This Is Sally!
print(s) # What happened to Anna?
print(s.title()) # What Happened To Anna?
print(title) # What Happened To Anna?
# .capitalize() は文の最初の文字を大文字にします
s = 'What happened to Anna?'
capital = s.capitalize()
print('Hi 123 this is Sally!'.capitalize()) # Hi 123 this is sally!
print(s) # What happened to Anna?
print(s.capitalize()) # What happened to anna?
print(capital) # What happened to anna?
# .swapcase() は小文字を大文字に、大文字を小文字に変換します
s = 'What happened to Anna?'
swapped = s.swapcase()
print('Hi 123 this is Sally!'.swapcase()) # hI 123 THIS IS sALLY!
print(s) # What happened to Anna?
print(s.swapcase()) # wHAT HAPPENED TO aNNA?
print(swapped) # wHAT HAPPENED TO aNNA?