-
Write a function countLetter(text, letter). text is a string, letter is a one-character string (a letter). The function should return how many times that letter appears in the string
# countLetter("trees", "t") -> 1
# countLetter("trees", "e") -> 2
# countLetter("trees", "E") -> 0
-
Write a function findLetter(A, B). A is a string, B is a one-character string (a letter). This should return the index of the left-most position where B can be found in A. If the letter B does not occur in the string A, return -1.
# findLetter("fish","f") -> 0
# findLetter("fish","F") -> -1
# findLetter("fish","h") -> 3
-
Write a function backwards(A). A is a string. Return a string like A but going through the characters backward. For example: backwards("pig milk") should return "klim gip"
-
Write a function emphasize(text). This should return a string like text, but with every "." changed to a "!". e.g., emphasize("Hi. You're great.") should return "Hi! You're great!"
-
Write a function isVowel(c). This should return True if c is an uppercase or lowercase vowel, and False otherwise.
-
Write a function countVowels(A). A is a string. This should return the number of vowels in the string A.
-
Write a function justTheVowels(A). A is a string. Return a string with only the vowels from A extracted.
justTheVowels("Aw, seriously??") -> "Aeiouy"
justTheVowels("Bzzt chhhggk") -> ""
-
Write a function everyOther(A, startAt). A is a string. startAt is an integer. Return a string composed of every second character of A, starting at startAt.
# everyOther("a1b2c3",0) -> "abc"
# everyOther("a1b2c3",1) -> "123"
# everyOther("a1b2c3",3) -> "23"
Try using it on this string: secret = "abnedf_omriel_eIs__stloe egpo"