How to use exception with else in Python

1 Answer

0 votes
try:
    print("Python")
except:
    print("Error")
else:
    print("OK")
 
'''
run:
 
Python
OK

'''

 



answered Nov 25, 2018 by avibootz

Related questions

3 answers 260 views
1 answer 151 views
1 answer 211 views
1 answer 204 views
2 answers 236 views
1 answer 216 views
3 answers 311 views
...