Python - Try Finally Clause

preview_player
Показать описание
Python - Try Finally Clause
Watch More Videos at:
Lecture By: Mr. Malhar Lathkar, Tutorials Point India Private Limited
Рекомендации по теме
Комментарии
Автор

he is wrong regarding the finally statement... it is generally used to close the files that are opened but not necessarily the case ... regardless there is an error or not.... Sample code
try:
a=1
b=2
print(a/b)
except ZeroDivisionError:
print('cant devide with 0')
else:
print('done')
finally:
print('all done... time to exit')

ayyappachodisetty
welcome to shbcf.ru