Тёмный

Python Exception Handling Tutorial for Beginners 

Dave Gray
Подписаться 345 тыс.
Просмотров 5 тыс.
50% 1

Опубликовано:

 

13 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 10   
@muzhaffarhaydar7928
@muzhaffarhaydar7928 23 дня назад
thanks dave!
@PeranMe
@PeranMe Год назад
Could you give a example of where finally isn’t… pointless, frankly? I mean, we could just leave it out and not indent what was once in the ”finally” code block and save *cough cough* maybe a dozen bytes of disk space. I’m sure there’s something clever here I’m missing, and I’d love to learn what it is. Thanks for another great video!
@DaveGrayTeachesCode
@DaveGrayTeachesCode Год назад
Sure! The example I always think of is closing a file no matter what happened before - error or not - other good examples in some answers here: stackoverflow.com/questions/11551996/why-do-we-need-the-finally-clause-in-python
@PeranMe
@PeranMe Год назад
@@DaveGrayTeachesCode aaah, I didn’t consider the case where you exit early! Thanks, much appreciated as always!
@khalilbenmeziane8836
@khalilbenmeziane8836 Год назад
thank you dave
@utinthein7274
@utinthein7274 Год назад
Thank you, Sir.
@DaveGrayTeachesCode
@DaveGrayTeachesCode Год назад
You are very welcome
@johnaweiss
@johnaweiss 8 месяцев назад
How are these different? try: .... except: .... finally: print("no error") try: .... except: .... print("no error")
@Sedona119
@Sedona119 4 месяца назад
finally: will always execute no matter what. If you put quit() or exit() in your code, the finally: would still be executed whereas if you just said print(), the print statement wouldn't run because the code would already be broken. finally: always executes, even after broken code but print() does not.
@johnaweiss
@johnaweiss 4 месяца назад
@@Sedona119 So the print won't execute if there's a break. So break exits the entre function?
Далее
Python Scope tutorial for Beginners
19:50
Просмотров 8 тыс.
Grand Final | IEM RIO 2024 | BO5 | КРNВОЙ ЭФИР
6:35:24
Python File Handling for Beginners
22:40
Просмотров 15 тыс.
Advanced Exception Handling in Python
12:06
Просмотров 63 тыс.
Git Tutorial for Absolute Beginners
36:21
Просмотров 73 тыс.
Python Closures for Beginners | Python tutorial
19:32
Python Lists & Tuples for Beginners | Python tutorial
32:01
Pydantic Tutorial • Solving Python's Biggest Problem
11:07
Python Command Line Arguments tutorial for Beginners
21:25