- 3

Help me solve this python question

Write a function that accepts a string and returns a dictionary with the number of digits and letters. Input String : "Python 3.2" Expected Output : {'Letters': 6, 'Digits': 2}

21st Nov 2021, 6:19 AM
Simon Varghese
Simon Varghese - avatar
2 Answers
+ 7
Simon Varghese , when you post your attempt we may help you in details.
21st Nov 2021, 7:16 AM
Lothar
Lothar - avatar
+ 5
Hint: Use isdigit() to count digits in the string argument Use isalpha() to count letters (alphabets) in the string argument
21st Nov 2021, 6:25 AM
Ipang