This is a bit trickier than it really should be
import maya.cmds as cmds
curSel = cmds.ls(sl=True)
gives you a list with the selected objects. However you will only have transforms in your list unless you explicitly selected the mesh or curve shape nodes, so you can't just ask for the meshes or shapes in the list.
To get the shapes you need to use listRelatives:
curveSel = []
meshSel = []
for xform in curSel:
shapes = cmds.listRelatives(xform, shapes=True) # it's possible to have more than one
for s in shapes:
if cmds.nodeType(s) == 'mesh':
curveSel.append(xform)
if cmds.nodeType(s) == 'nurbsCurve':
meshSel.append(xform)
This checks the shapes on each object and assigns it to the right list based on the shape types.