dimanche 20 décembre 2020

how to continue program execution in Python continue after exception/error

I am a teacher of python programming. I've gave some homeworks to my students, and now I have to correct them. The homework are submitted as functions. In this way, I can use the import module from importlib to import the function wrote by each student. I have put all the tests inside a try/except, but when some student did wrong (i.e., asks for user input, wrong indentation, etc.) the main test program hangs or stops.

There is a way to perform all the tests without making 5he main program stop because of students errors?

Thanks in advice

Aucun commentaire:

Enregistrer un commentaire