Oct-31-2017, 07:26 PM
Quote:if line.startswith (city):
That line doesn't throw an error if it doesn't find the substring, it just returns False. try/except catch errors, full stop. If there's no error, an except block will not run.
try and except
|
|
Messages In This Thread |
try and except - by anonymouspanda - Oct-30-2017, 08:52 PM
RE: try and except - by Lux - Oct-30-2017, 09:26 PM
RE: try and except - by anonymouspanda - Oct-31-2017, 06:32 PM
RE: try and except - by nilamo - Oct-31-2017, 07:26 PM
|