commit-live-students / 003-count-letters-and-digits

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python Programming Basics - Assignment

Problem Statement:

Write a program that accepts a sentence and calculate the number of letters and digits.

  1. Define function 'letterAndDigit' which will accept a string as argument.
  2. String should not be empty or none.
  3. Calculate number of digits and characters inside string and return a dict object in format of {"DIGITS":count, "LETTERS":count}.
  4. 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}
    

About


Languages

Language:Python 100.0%