Skip to content

Conversation

AlexN-github
Copy link

Сделал все.

FullNameDir = os.path.join(current_path, "dir_"+str(i))
os.mkdir(FullNameDir)
print("Директории dir_1..dir_2 созданы")
except FileExistsError:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

так, а если ошибка вылетит на первой же итерации, получиться что вообще ни одной папки не создастся

if os.path.isdir(FullNameDir):
os.rmdir(FullNameDir)
print("Директории dir_1..dir_2 удалены")
except :

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

очень плохая практика, хотя бы Exception надо писать

@@ -13,3 +13,53 @@
# Для решения данной задачи используйте алгоритмы из задания easy,
# оформленные в виде соответствующих функций,
# и импортированные в данный файл из easy.py

import os
def action1():

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

функциям всеже лучше давать имена которые дают понмание что именно она делает

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants