I want to know how do I know if there exists a specific value in a list and also to return it if exists!
a_list = [1, 2, 3, 4]
value = 1
if value in a_list:
return value
else: return None
I know that the above code works, but I want to know whether there is a one-liner way of doing it?