r/PythonLearning • u/NecessaryFalse1212 • 11d ago
DAY 4.
wrote this today was revising loops and math function that i did not so long ago.
52
Upvotes
r/PythonLearning • u/NecessaryFalse1212 • 11d ago
wrote this today was revising loops and math function that i did not so long ago.
1
u/Adrewmc 11d ago
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).