Fix Python – What is the pythonic way to detect the last element in a ‘for’ loop?

I’d like to know the best way (more compact and “pythonic” way) to do a special treatment for the last element in a for loop. There is a piece of code that should be called only between elements, being suppressed in the last one.
Here is how I currently do it:
for i, data in enumerate(data_list):
code_that_is_done_for_every_element
if i !=….

Fix Python – Python idiom to return first item or None

I’m calling a bunch of methods that return a list. The list may be empty. If the list is non-empty, I want to return the first item; otherwise, I want to return None. This code works:
def main():
my_list = get_list()
if len(my_list) > 0:
return my_list[0]
return None

but it seems to me that there should be a simple one-line….