How can I check the extension of a file?

I'm working on a certain program where I need to do different things depending on the extension of the file. Could I just use this?

if m == *.mp3
   ...
elif m == *.flac
   ...
138
задан nbro 30 September 2019 в 18:47
поделиться