Skip to content

Conversation

@DmytroBurdenko
Copy link

No description provided.

@@ -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.

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

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

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)

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

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

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

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

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