Create a function in Python named numCharacter (s) which takes as parameter one character string s. The function returns an integer which is the number of characters in s which are meeting the criteria below. The criteria are: lowercase letters from e to j (inclu
. For this question, lists are not allowed.
Create a function in Python named numCharacter (s) which takes as parameter one
character string s. The function returns an integer which is the number of characters in s which are
meeting the criteria below.
The criteria are: lowercase letters from e to j (inclusive), uppercase letters from F to X
(inclusive), the numbers 2 to 6 (inclusive), the exclamation mark (!), the comma (,), and the bar
backslash (backslash) (\). For example, if the string contains two ‘X’, the function must count
these two 2 characters.
Respect the type contract (str) -> int
Reminder: no lists in this function
Examples of tests in the Shell:
>>> numCharacter ("one, two")
3
>>> numberCharacter ("2aAb3? eE'_13")
4
>>> numCharacter ("2 \ '")
1
>>> numCharacter ("\\")
1
Step by step
Solved in 3 steps with 1 images