Python for Engineers
Solve Problems by Coding Solutions - A Complete solution for python programming
Blog Pages
Code
Top 10 Blogs
NumPy Tutorials
Distributions
Self Learning
IDE
Packages
About
Count of character repetition in a string
word=str(raw_input('Enter the string:'))
n=raw_input('Enter the character to search in string:')
c=0
for i in word:
if i==n:
c=c+1
print 'Number of times the character repeated is', c
No comments:
Post a Comment
Newer Post
Older Post
Home
View mobile version
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment