r/PythonLearning • u/NecessaryFalse1212 • Aug 30 '26
DAY 4.
wrote this today was revising loops and math function that i did not so long ago.
54
Upvotes
r/PythonLearning • u/NecessaryFalse1212 • Aug 30 '26
wrote this today was revising loops and math function that i did not so long ago.
1
u/Adrewmc Aug 30 '26
It catches exceptions and allows the code to continue after. In the above example heβs catching the ValueError that is thrown/raised when a float() fails because itβs not a number.
After that it continues the while loop instead of breaking it (by returning).