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 443 views
1 answer 250 views
1 answer 312 views
1 answer 293 views
2 answers 362 views
1 answer 327 views
3 answers 468 views
...