diff --git a/__pycache__/__init__.cpython-36.pyc b/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000..a7d9f81 Binary files /dev/null and b/__pycache__/__init__.cpython-36.pyc differ diff --git a/q01_longest_even_word/__pycache__/__init__.cpython-36.pyc b/q01_longest_even_word/__pycache__/__init__.cpython-36.pyc index 8ad4b68..b272c14 100644 Binary files a/q01_longest_even_word/__pycache__/__init__.cpython-36.pyc and b/q01_longest_even_word/__pycache__/__init__.cpython-36.pyc differ diff --git a/q01_longest_even_word/__pycache__/build.cpython-36.pyc b/q01_longest_even_word/__pycache__/build.cpython-36.pyc index 7926364..823d057 100644 Binary files a/q01_longest_even_word/__pycache__/build.cpython-36.pyc and b/q01_longest_even_word/__pycache__/build.cpython-36.pyc differ diff --git a/q01_longest_even_word/build.py b/q01_longest_even_word/build.py index 0685739..f266c89 100644 --- a/q01_longest_even_word/build.py +++ b/q01_longest_even_word/build.py @@ -1,9 +1,24 @@ +# %load q01_longest_even_word/build.py # Default imports import re +b = 0 # Write your solution here : def q01_longest_even_word(sentence): + # split the string + s = sentence.split() + ev_li = [] + for i in s: + if (len(i) % 2 == 0): + ev_li.append(i) + if ev_li == []: + b=0 + if ev_li != []: + b = max(ev_li, key=len) + return b + + diff --git a/q01_longest_even_word/tests/__pycache__/__init__.cpython-36.pyc b/q01_longest_even_word/tests/__pycache__/__init__.cpython-36.pyc index 7782007..ca387d2 100644 Binary files a/q01_longest_even_word/tests/__pycache__/__init__.cpython-36.pyc and b/q01_longest_even_word/tests/__pycache__/__init__.cpython-36.pyc differ diff --git a/q01_longest_even_word/tests/__pycache__/test.cpython-36.pyc b/q01_longest_even_word/tests/__pycache__/test.cpython-36.pyc index a62a5d8..047eac5 100644 Binary files a/q01_longest_even_word/tests/__pycache__/test.cpython-36.pyc and b/q01_longest_even_word/tests/__pycache__/test.cpython-36.pyc differ