Answer:
Hi Kyelawright! Please find the answer below.
Explanation:
As the question suggested, we can simply use the isdigit() function in Python to check if the current string is a digit and update the digits counter if it returns true.
import sys;
def countDigits(s):
digits_count = 0;
for x in range(0, len(s)):
if s[x].isdigit():
digits_count += 1;
return digits_count;
s = input("Enter a sentence: ");
print(countDigits(s));