PYHTON PROGRAM
str=input("Enter a String:")
ch=input("Enter a Character:")
flag=0
count=0
for i in range(len(str)):
if(str[i]==ch):
flag=1
count=count+1
if(flag==1):
print ("Character",ch,"is occured in String",count,"times")
else:
print ("Character",ch,"is not found")
No comments:
Post a Comment
let me know which type examples you want to comment me.