From 28d160de737bce1cf821e02bec0e2326f4bcd138 Mon Sep 17 00:00:00 2001 From: sohayelmahmud Date: Wed, 26 Nov 2025 09:56:23 +0600 Subject: [PATCH] fix: correct logical flow for subdomain and list pairing --- .../Hackerrank_Solution_Blank_File_Creator.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/HackerrankUtility/Hackerrank_Solution_Blank_File_Creator.py b/HackerrankUtility/Hackerrank_Solution_Blank_File_Creator.py index 6866980..d57b12e 100644 --- a/HackerrankUtility/Hackerrank_Solution_Blank_File_Creator.py +++ b/HackerrankUtility/Hackerrank_Solution_Blank_File_Creator.py @@ -13,7 +13,7 @@ extension = ".py" domain = "Python" -author = "Ahmedur Rahman Shovon" +author = "Sohayel Mahmud" created_date = datetime.datetime.today().strftime("%d %B %Y") info_file_name = "python_info.txt" @@ -43,7 +43,7 @@ def write_file_header(title, subdomain): line = line.strip() if line == "": continue - elif line[0] == "[": + elif line.startswith("["): problem_list = line else: subdomain_name = line @@ -57,10 +57,10 @@ def write_file_header(title, subdomain): for title in title_ar: file_header_str = write_file_header(title[1:-1], subdomain_name) title_valid = valid_name(title) - f = open(folder_name + "\\" + title_valid + extension, "w") + f = open(os.path.join(folder_name, title_valid + extension), "w") f.write(file_header_str) f.close() print("Folder: " + str(folder_name) + ". Total files: " + str(title_ar_len)) subdomain_name = "" - problem_list = "" + problem_list = "" \ No newline at end of file