Alternative to bare except in Python?
Documentation on exception handling tends to focus on using specific exception types – which is good advice in general.
Alternative to bare exceptions in Python?
Reading documentation on exception handling tends to focus on using spesific exception types – which is good advice in general.
Changing the exception type in a context manager
I currently have code that looks like this scatterred throughout my codebase:
Difference between ‘except’ and ‘except Exception’ in Python [duplicate]
This question already has answers here: Difference between except: and except Exception as e: (5 answers) Difference between except: and except Exception: (2 answers) Closed 1 min ago. Is there any difference between try: 1 # some exception except: pass and try: 1 # some exception except Exception: pass Please note: This question is not […]
I want to get an exception in the variable anyvalue
I want to get an exception in the anyvalue variable if i put a value like float (with any value too, but neihter text or int), but it doesn’t work
it only works in the following variables, if i put any text in the anyvalue (on which i want to work, the first variable of the script), it does a thing, and the same with number, but if i put a float value(for example) it doesn’t give me the exception and takes it as if it were a int
I want to get an error if the 1st value is neihter text or value
Frst of all, ignore the spanish text, just take a look in the functions and variables