Light Mode
Dark Mode
Is it a bug in Electronic station / Words Order?

After check Checkio shows me an error, see in attachment.

def words_order(text: str, words: list) -> bool:

splitted_text = text.split()
new_list = []
for word in splitted_text:
    if word in words:
        new_list.append(word) 

return new_list == words

if name == 'main': print("Example:") print(words_order("hi world world im here",["world","world"]))

# These "asserts" are used for self-checking and not for an auto-testing
assert words_order("hi world world im here",["world","world"]) == False
Attachment
  • bug
  • code_review
  • python
Created: July 8, 2021, 8:11 a.m.
Updated: July 8, 2021, 8:57 a.m.
0
10
User avatar
klaster83