diff --git a/burdenkods/first/Task1.py b/burdenkods/first/Task1.py new file mode 100644 index 0000000..409b5fe --- /dev/null +++ b/burdenkods/first/Task1.py @@ -0,0 +1,5 @@ +""" +Check len of element, if len == 0, add to counter +UPD: Sorry, reviewer, I've no idea what this is supposed to mean, so let's just say we need to find all the +elements with a value of "" +""" \ No newline at end of file diff --git a/burdenkods/first/Task2.py b/burdenkods/first/Task2.py new file mode 100644 index 0000000..91a284b --- /dev/null +++ b/burdenkods/first/Task2.py @@ -0,0 +1,5 @@ +""" +Text - list; print with step 3 +""" +text = ["Hello, my name is this"] +print(text 5: :3 1) diff --git a/burdenkods/first/Task3.py b/burdenkods/first/Task3.py new file mode 100644 index 0000000..cc44234 --- /dev/null +++ b/burdenkods/first/Task3.py @@ -0,0 +1,12 @@ +""" +2 float numbers: print list in range (num1, num2) +""" + +lower_bound = int(input("Enter first number: ")) +upper_bound = int(input("Enter second number: ")) +if upper_bound >= lower_bound: + for i in range(lower_bound, upper_bound + 1): + print(i) +else: + for i in range(upper_bound, lower_bound + 1): + print(i) diff --git a/burdenkods/second/Task1.py b/burdenkods/second/Task1.py new file mode 100644 index 0000000..8fb6c30 --- /dev/null +++ b/burdenkods/second/Task1.py @@ -0,0 +1,31 @@ +""" +You are given a "folder" with sub-folders and files. +User enters a file path. If it's executable (and you can find the file at the end), return True. +""" +import re + + +folder = ['D:', ['recycle bin'], ['tmp', ['old'], ['new folder1', 'asd.txt', 'asd.bak', 'find.me.bak']], 'hey.py'] +#file_path = 'D:/tmp/new folder1' +file_path = 'D:/tmp/new folder1' + + +def path_decoder(): + global file_path, filepathnew + filepathnew = file_path.split('/') + return filepathnew + + +def file_search(folder): + path_level = 0 + while path_level <= len(filepathnew): + regexpr = bool(re.findall(filepathnew[path_level], folder)) + if regexpr: + path+=1 + continue + current_folder = filepathnew[1] + +#find length of filepathnew, use for cyclical search + + +#print(path_decoder())