Python for Engineers
Solve Problems by Coding Solutions - A Complete solution for python programming
Blog Pages
(Move to ...)
Code
Top 10 Blogs
NumPy Tutorials
Distributions
Self Learning
IDE
Packages
About
▼
Searching the character count from string
word = raw_input('Enter the String:')
char = raw_input('Enter the Character to search:')
count = 0
for letter in word:
if letter == char:
count = count + 1
print 'Number of times repeated:', count
No comments:
Post a Comment
‹
›
Home
View web version
No comments:
Post a Comment