phrase = input("チェックする文字列?") if phrase == phrase[::-1]: print(f"「{phrase}」は回文です!") else: print(f"「{phrase}」は回文ではないです!") # プログラム8-19(回文チェック ②:スライス版)