hi,
if you want to do it absolutely in one line, maybe something like
getCentroid = lambda inputs : [sum([a[x] for a in inputs]) / float(len(inputs)) for x in range(3)] if len(inputs) else None
? Then you can use
getCentroid([[1, 0, 0], [0, 1, 0], [-1, 0, 0]])
for example.
But why doing it in one line, it becomes a bit complicated if other people have to read your code.