It's very easy to prefill a repl in pyscript, the framework by anaconda that let's you use python as a script language in a web page. You can also insert a repl into a web page and is also very easy to insert prefilled code inside of it.
https://pythonprogramming.altervista....