Skip to content

Instantly share code, notes, and snippets.

@a1exDi
Last active April 1, 2022 15:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save a1exDi/00c2ce4c46654176cb151128108b12ca to your computer and use it in GitHub Desktop.
Save a1exDi/00c2ce4c46654176cb151128108b12ca to your computer and use it in GitHub Desktop.
Вычислить количество букв в слове или предложении.
function count_letters(word) {
var count = 0;
for (var i = 0; i < word.length; i++) {
count += 1;
}
return count;
}
def count_letters(word):
count = 0
for i in word:
count += 1
return count
func count_letter(word: String)-> Int {
var count = 0
for i in word{
count += 1
}
return count
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment