pycharm said it not right | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

pycharm said it not right

try: print(1 / 0) except ZeroDivisionError: raise ValueError

15th May 2020, 2:56 AM
GUANLIANG Shi
GUANLIANG Shi - avatar
1 ответ
0
you are raising an exception to handle a previous one. what is the point of raise ValueError? you could instead, print("You can not divide by zero")
15th May 2020, 4:25 AM
Bahhaⵣ
Bahhaⵣ - avatar