Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions burdenkods/first/Task1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""
Check len of element, if len == 0, add to counter

Choose a reason for hiding this comment

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

Завдання некоректно побудовано

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 ""
"""

Choose a reason for hiding this comment

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

Якщо я правильно розумію завдання, то воно має виглядати так
rand_list = [[], 5, 6, [], 5, "element", [1], []]
counter = 0
for el in rand_list:
if isinstance(el, list) is True and len(el) == 0:
counter += 1
print(counter)

5 changes: 5 additions & 0 deletions burdenkods/first/Task2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""
Text - list; print with step 3
"""
text = ["Hello, my name is this"]

Choose a reason for hiding this comment

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

На скільки я зрозумів завдання, ліст має містити багато строк

Choose a reason for hiding this comment

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

Тут не правильно оформлений слайс, слайс має бути оформлений так:
text = ["Hello", "my", "name", "is", "Oleh", "I", "leave", "in", "Kiev", "I", "love", "KPI!"]
print(text[::3])

print(text 5: :3 1)
12 changes: 12 additions & 0 deletions burdenkods/first/Task3.py
Original file line number Diff line number Diff line change
@@ -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)
31 changes: 31 additions & 0 deletions burdenkods/second/Task1.py
Original file line number Diff line number Diff line change
@@ -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())