I have a python logic like this:
file = 'POMNI2022.csv'
pomni=False
if 'POMNI' in file:
pomni=True
else:
pass
Is there any way I can use just 1 line code for the if else logic here?
>Solution :
You already have an expression that evaluates to True or False:
pomni = 'POMNI' in file