diff --git a/__pycache__/__init__.cpython-36.pyc b/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000..5b3b47c 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..32a7b21 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..d22812d 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..e9bbc87 100644 --- a/q01_longest_even_word/build.py +++ b/q01_longest_even_word/build.py @@ -1,9 +1,28 @@ +# %load q01_longest_even_word/build.py # Default imports -import re +#import re +# Write your solution here : +import re # Write your solution here : def q01_longest_even_word(sentence): - - + x=sentence.split() + cond = [ word for word in x if len(word) % 2 == 0] + print (cond) + if not cond: + return 0 + else: + return max(cond, key=len) + +re + +q01_longest_even_word('a bbb cccccc ddd') + + + + + + + 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..e97fb9a 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..a630a74 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