Welcome to the forum, feel free to ask questions here.
import maya.cmds as mc selectedVertex = mc.ls(selection=True, flatten=True) for vtx in selectedVertex: mc.setAttr(vtx, edit=True, lock=True)