startswith
endswith
count
지정 문자열로 끝나는지 확인합니다.
str.endswith(suffix, start?, end?)
아래 값을 입력하면 예제에 즉시 반영됩니다.
filename
print
filename = "report.pdf" print(filename.endswith(".pdf")) # True print(filename.endswith(".txt")) # False