From 20f1b8698e46594bc7b292846bdd1ac8bff080ea Mon Sep 17 00:00:00 2001 From: EminentNeo Date: Wed, 21 Nov 2018 08:41:51 +0000 Subject: [PATCH] Done --- __pycache__/__init__.cpython-36.pyc | Bin 0 -> 164 bytes .../__pycache__/__init__.cpython-36.pyc | Bin 183 -> 186 bytes .../__pycache__/build.cpython-36.pyc | Bin 949 -> 1004 bytes q01_longest_even_word/build.py | 19 +++++++++++++++++- .../tests/__pycache__/__init__.cpython-36.pyc | Bin 189 -> 192 bytes .../tests/__pycache__/test.cpython-36.pyc | Bin 1915 -> 1918 bytes 6 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 __pycache__/__init__.cpython-36.pyc diff --git a/__pycache__/__init__.cpython-36.pyc b/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0304d3715bdc6b0b4a5937b580dc9ebda72ceeb1 GIT binary patch literal 164 zcmXr!<>lg*`Wns1z`*brh~WSv-~hzMEI=ZKA(%mv(QhR~5l9$8{0h|1$j?pHcg@Yr zOU*0sOU>60&o9a@E=WvH)lbe(N!3p)N=zF4FdJro~ literal 0 HcmV?d00001 diff --git a/q01_longest_even_word/__pycache__/__init__.cpython-36.pyc b/q01_longest_even_word/__pycache__/__init__.cpython-36.pyc index 8ad4b6849d62317c5e52518abbc96bf938016804..254475331add31433eba9dbfc30caa8fe8b2c1ce 100644 GIT binary patch delta 52 zcmdnaxQmg)n3tD}Tk31{L=JO>bp4F{+*Ezn+|0bxyb{0EeEsnJqU_>=#N<@{ Hi80Xtr8yCZ delta 49 zcmdnRxSf&1n3tF9%;9HI6FJOfQ}i?Pb5r#blQJ^(UGmHGa`F>XiuGMmi?d7e3ns=# F0|2DQ5xf8Z diff --git a/q01_longest_even_word/__pycache__/build.cpython-36.pyc b/q01_longest_even_word/__pycache__/build.cpython-36.pyc index 7926364e1294456cec2db64f01401301047eda48..7e2d1c073bdfa82818172578c7a5419058e92cbe 100644 GIT binary patch literal 1004 zcmZuw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@a16U9?wK^4ozh^wSNe6O>E`BY$yl~%oYl#nf|pP>QTCcAjQ#Cw;x vbdRWg^oFk5!zu0*!p!^kKS(XVjyJtqG7l80;AkP)Qt)GoO(N^lj7sk diff --git a/q01_longest_even_word/build.py b/q01_longest_even_word/build.py index 0685739..039291b 100644 --- a/q01_longest_even_word/build.py +++ b/q01_longest_even_word/build.py @@ -1,9 +1,26 @@ +# %load q01_longest_even_word/build.py # Default imports import re +from nltk.tokenize import word_tokenize +sentence = 'photographs or other images, readers can start to get a sense about the topic. This scanning and skimming helps set the expectation for the reading.' +data1 = 'One great way to make predictions about an unfamiliar nonfiction text is to take a walk through the book before reading.' -# Write your solution here : def q01_longest_even_word(sentence): + new = sentence.split(' ') + for x in new: + if x == '': + new.pop(0) + even = [x for x in new if len(x)%2 == 0] + if len(even) != 0: + return max(even,key = len) + if len(even) == 0: + return 0 +q01_longest_even_word(data1) + + + + 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 7782007a6d513192b9ba7509abb59f87e256a09f..1d662f4138f64e232f6fa928370b2c56573f7888 100644 GIT binary patch delta 52 zcmdnXcz}_^n3tE!RqAW>L=JO>T>Xsv+*Ezn+|0bxyb{0EeEsnJqU_>=#N<@{ Hi7|-)vNI9d delta 49 zcmX@WxR;T`n3tF9#^GmC6FJOfv-C6ab5r#blQJ^(UGmHGa`F>XiuGMmi?d7e3ns=V F0syJ45#Rs- 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 a62a5d8dc0a25e6368ba602812bc8d872975e0fa..e9eae5c47d3e3e370cf057df8ac9221b4e60fdfb 100644 GIT binary patch delta 55 zcmey(_m7Xmn3tE!RqAW>Mh<3Xg-rd7{M=N1*WAp!)VvbE)O`K${G#mQg2d!h{p9?V K)Xf^q!7KpwIub$v delta 52 zcmeyz_nVKyn3tC;>)NxZjU3F(vT6Dm`MIh3iAfom`Y!q9c{%xsDaHCOsm0kP`30M` HnS)sX-VG7$