Print error without stopping the for loop in Python

Print error without stopping the for loop in Python

If you are using a for loop and you want to know what the error is when it occurs without stopping the for loop, use try and except.

Remember to add Exception as e after except statement to print the error like above.

Scroll to Top

Work with Khuyen Tran

Work with Khuyen Tran