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 447 views
1 answer 253 views
1 answer 314 views
1 answer 296 views
2 answers 363 views
1 answer 329 views
3 answers 470 views
...