📅  最后修改于: 2022-03-11 14:46:16.591000             🧑  作者: Mango
# Checking for single extension (.txt) of file
if file.endswith(".txt"):
# do something
# Checking multiple extensions (.txt, .pdf, .mp3, ...)
if file.endswith((".txt", ".pdf", ".mp3")):
# do something