How to split a Mesh with random_selection
Here is another take, that randomly selects from all faces using randint(0, len(faces)) pops the selected face from faces list and adds to selected until the desired length is achieved. 

import bpy
from random import randint

context = bpy.context
obj = context.edit_object
mesh = obj.data
# check that percent is between 0 and 100.
percent = 40
# test code to run in edit mode
import bmesh
bm = bmesh.from_edit_mesh(mesh)
# deselect all
for f in bm.faces:
    f.select = False
# amount that need to be selected (to nearest int)
select_count = int(percent * len(bm.faces) / 100)
# unselected 
faces = [f for f in bm.faces] # could use f.index
# selected
selected = []

while len(selected) &lt; select_count:
    # choose randomly from faces
    i = randint(0, len(faces) - 1)

    # pop and select
    f = faces.pop(i)
    f.select = True
    selected.append(f) # or use f.index
bmesh.update_edit_mesh(mesh)

print("Selected %d of %d" % (len(selected), len(bm.faces)))