I have this string:
questioncode = YED_q2_a_10
I want to check if the string ends with an underscore then an int
i.e. "_293"
My attempt:
codesplit = questioncode.split('_')[-1]
if codesplit.isdigit():
print "true"
else:
print "false"
as you can see this is not doing what I want and I believe regex is the solution.