I would like to keep in a variable the condition applied, for example:
l = "test.log"
if l.endswith('.csv') or l.endswith('.log') or l.endswith('.xlsx'):
print(someVariable)
.log
l = "test.csv"
if l.endswith('.csv') or l.endswith('.log') or l.endswith('.xlsx'):
print(someVariable)
.csv
How can I perform that without a switch case? I just wanna know which condition was performed.
if ... elif ... elif ... else.