Write a program that accepts a sentence and calculate the number of letters and digits.
- Define function 'letterAndDigit' which will accept a string as argument.
- String should not be empty or none.
- Calculate number of digits and characters inside string and return a dict object in format of {"DIGITS":count, "LETTERS":count}.
- Function should pass all test cases.
Instructions:
-
Program should be written in file letter_digit.py
-
Function name should be letterAndDigit.
-
Input
Type: String Value: 'world! 234'
-
Expected Output
Type: Dictionary Value: {'DIGITS' : 3, 'LETTERS' : 5}