Snap objects to floor I'm a beginner in blender scripting, in How to place any object on the &#39;floor&#39; of a scene?, @MACHIN3 wrote this simple but smart code. Can you explain me the meaning of every line?

import bpy
context = bpy.context

for obj in context.selected_objects:
    mx = obj.matrix_world
    minz = min((mx @ v.co)[2] for v in obj.data.vertices)
    mx.translation.z -= minz


In the same question the topic of how can integrate this code in Blender as a button is very interesting, can you help me with this? Actually I'm working with tutorials, Manuals, etc. but I'm afraid my knowledge is not enough.
My answer in 

[1]How to place any object on the &#39;floor&#39; of a scene?

My addon append one item in Object>Snap menu