How do I create a vertex group from selected vertices in edit Mode with Python (Blender 2.8)?
This is the better and simplified solution that I could do:
import bpy

bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.select_mode(use_extend=False, use_expand=False, type='VERT')
bpy.ops.mesh.select_all(action='SELECT')
bpy.ops.mesh.extrude_region_move(MESH_OT_extrude_region={&quot;use_normal_flip&quot;:False, 
&quot;mirror&quot;:False}, TRANSFORM_OT_translate={&quot;value&quot;:(0, 0, 0.5), &quot;orient_type&quot;:'GLOBAL', 
&quot;orient_matrix&quot;:((1, 0, 0), (0, 1, 0), (0, 0, 1)), &quot;orient_matrix_type&quot;:'GLOBAL', 
&quot;constraint_axis&quot;:(False, False, True), &quot;mirror&quot;:False, &quot;use_proportional_edit&quot;:False, 
&quot;proportional_edit_falloff&quot;:'SMOOTH', &quot;proportional_size&quot;:1, 
&quot;use_proportional_connected&quot;:False, &quot;use_proportional_projected&quot;:False, &quot;snap&quot;:False, 
&quot;snap_target&quot;:'CLOSEST', &quot;snap_point&quot;:(0, 0, 0), &quot;snap_align&quot;:False, &quot;snap_normal&quot;:(0, 
0, 0), &quot;gpencil_strokes&quot;:False, &quot;cursor_transform&quot;:False, &quot;texture_space&quot;:False, 
&quot;remove_on_cancel&quot;:False, &quot;release_confirm&quot;:False, &quot;use_accurate&quot;:False})
bpy.ops.transform.edge_bevelweight(value=1)

# New Vertex group from selected vertices

bpy.context.object.vertex_groups.new(name='New_Vertex.000')
bpy.ops.object.vertex_group_assign()