Skip to content

Instantly share code, notes, and snippets.

View gda1335's full-sized avatar
🎯
Focusing

Gizem gda1335

🎯
Focusing
View GitHub Profile
@bbookman
bbookman / words_more_than_4.py
Created December 26, 2018 23:06
Python List Comprehension: Find words with more than 4 letters
'''Find all of the words in a string that are less than 4 letters'''
sentence = 'On a summer day somner smith went simming in the sun and his red skin stung'
examine = sentence.split()
result = [word for word in examine if len(word) >=4]
print(result)