T.E.M Κεφ8 Δρ7 maxLength(wordList)
Τι θα εμφανίσει;
def maxLength(wordList):
maxLen = 0
maxWord = ''
for word in wordList:
if len(word) > maxLen:
maxLen = len(word)
maxWord = word
return maxWord
L=['I', 'am', 'learning', 'Python', 'OLE']
print maxLength(L)
OLE | |
learning | |
Python | |
8 |