Take the output of the command "find . -iname '*.py' -exec grep -l -i import \{\} +" (which finds all Python files in the current directory and subdirectories that contain the word "import"), shuffle the output, and then use xargs to take one line at a time and delete the file.
xargs -a <(shuf $(find . -iname '*.py' -exec grep -l -i import \{\} +)) -n1 rm -f