2023-06-25 Python - str.endswith(suffix[, start[, end]]):文字列の最後が指定文字でおわるか Python3 文字列メソッド 概要 実行結果 表示イメージ 概要str.endswith(suffix[, start[, end]])suffix:対象文字 start,end:スライスと同一 文字列の最後が指定文字でおわるか 組込み型 文字列メソッド 実行結果 eng1 = 'abcdefg' print(eng1.endswith('g')) print(eng1.endswith('c')) print(eng1.endswith('c',1,3)) 表示イメージ True False True