Answer to Question #329940 in Python for Shubham Tiwari

Question #329940

Write a Python program that accepts a string and calculate thenumber of digits and letters


Sample Data : Python 3.9


Expected Output :


Letters 6


Digits 2

1
Expert's answer
2022-04-18T08:41:48-0400

Hello!

It's ready!


import sys

arg = sys.argv[1]

print('Letters', sum(c.isalpha() for c in arg))
print('Digits', sum(c.isdigit() for c in arg))

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS