Skip to content

Instantly share code, notes, and snippets.

@symtkn
Created March 26, 2011 21:50
Show Gist options
  • Save symtkn/888670 to your computer and use it in GitHub Desktop.
Save symtkn/888670 to your computer and use it in GitHub Desktop.
Cümlede geçen en uzun kelimeyi bulup ekrana yazdıran program
#!/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