Created
March 26, 2011 21:50
-
-
Save symtkn/888670 to your computer and use it in GitHub Desktop.
Cümlede geçen en uzun kelimeyi bulup ekrana yazdıran program
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf8 -*- | |
def en_uzun_kelime(cumle): | |
liste = cumle.split() | |
uzunluklar = [] | |
for i in liste: | |
uzunluk = reduce(lambda x,y:len(i),liste) | |
uzunluklar.append(uzunluk) | |
en_uzun = max(uzunluklar) | |
sira = uzunluklar.index(en_uzun) | |
print liste[sira] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment