Ahmet Taha

Ahmet Taha

  • 1.7k
  • 363
  • 7.1k

Python Problem in Iteration

Sep 9 2021 7:56 AM

Create a python script that accepts a sentence input (string). The script should be able to iterate through each character of the string, and count (int) how many letters, and numbers are there within the string. Once these values are determined the following output should be printed: "The sentence contained n1 letters and n2 numbers." - where n1 is the letter count, and n2 is the number count.

sample input:

sample output
The sentence contained 5 letters and 3 numbers.

Answers (1)