I would like to check if a variable contains a substring at the end
eg
text = 'lord_of_pizzas_DFG' if('DFG' in text): print('You shall pass') elif('DFG' not in text): print('You shall not pass')
The problem is that if text='DFG_pizza_man' , it will still print "You will pass." I want to know how to check if DFG is at the end of a line.
source share