Input Format:The only line contains a non-empty text composed only of uppercase letters of English alphabet.
Output Format:output a single line containing the number of holes in the corresponding text.
Example-1
Input:
DRINKEATCODEOutput:
5Explanation:
D R A O D has one hole hence total number of holes in the text is 5.Source Code
ip=input() c=0 H1=["A", "D", "O", "P", "R",'Q'] H0=['C','E','F','G','H','I','J','K','L','M','N','S','T','U','V','W','X','Y',"Z"] for i in ip: if i in H1: c+=1 elif i in H0: pass else: c+=2 print(c,end='')
Comments
Post a Comment
If you have any doubts? Please let me know.