dimanche 8 mars 2015

Python: How to raise an exception when keyword does not match up?


Vote count:

0




When comparing strings I want to raise an exception when they do not equal:



x = 'obama'
if x == 'obama' or 'bush' or 'kennedy' :
pass
else:
raise exception


asked 1 min ago







Python: How to raise an exception when keyword does not match up?

Aucun commentaire:

Enregistrer un commentaire