Created
January 5, 2019 12:07
-
-
Save deHelden/3ee7b3caecdff141f7d516f73df54128 to your computer and use it in GitHub Desktop.
[Task 8] Count words in a string
This file contains hidden or 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
# 8) Дана строка в которой записаны слова через пробел. Необходимо посчитать | |
# количество слов. | |
def word_counter | |
string = "alskdfj asd;lfjk asdkfj;lasd flaskdj f as;dlfjk a;sd fkla sdf;" | |
string.split.size | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment