Ahmet Taha

Ahmet Taha

  • NA
  • 381
  • 17.9k

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:
hEllo321!

sample output
The sentence contained 5 letters and 3 numbers.


Answers (1)