Write a Python Program to Count Alphabets Digits and Special Char in String

Publié le: 01 octobre 2022
sur la chaîne: Code With TJ
2,286
26

Hi Guys, Welcome to my channel.

In this video you will learn about how to Write a Python Program to Count Alphabets Digits and Special Char in String


Python Scripts
======================
https://codewithtj.blogspot.com/2024/...

Python Functions Solved
==========================
https://codewithtj.blogspot.com/2023/...

Python Programs Solved
============================
https://codewithtj.blogspot.com/2023/...



Code
=============================
"""
Write a Python Program to Count Alphabets Digits and Special Char in String
"""

my_string = input("Enter a string : ")

alpha_count, digit_count, s_char_count = 0, 0, 0

for letter in my_string:
if letter.isalpha():
alpha_count += 1
elif letter.isdigit():
digit_count += 1
else:
s_char_count += 1

print("Alphabet Count is : ", alpha_count)
print("Digit Count is : ", digit_count)
print("Special Char Count is : ", s_char_count) c



Keywords
=============================
#python #python3 #python_assignment #pythonprogramming #pythontutorial #pythonprojects #pythoncourse #pythonbaba #pythonforbeginners #pythonautomation #pythonbasic #pythonbeginners


Sur cette page du site, vous pouvez voir la vidéo en ligne Write a Python Program to Count Alphabets Digits and Special Char in String durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Code With TJ 01 octobre 2022, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 2,286 fois et il a aimé 26 téléspectateurs. Bon visionnage!