Consider the following simple code:
import re
def my_match(s):
if re.match("^[a-zA-Z]+", s):
return True
else:
return False
Is there a way to collapse this in a single return
statement? In C
we could do for example:
return match("^[a-zA-Z]+", s) ? true : false;
Is there something similar in python?