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
Solve Problems by Coding Solutions - A Complete solution for python programming
To check a string is palidrome or not
k=raw_input('Enter a string: ')
if k==k[::-1]:
print 'String is palidrome'
else:
print 'String is not palidrome'
if k==k[::-1]:
print 'String is palidrome'
else:
print 'String is not palidrome'
Subscribe to:
Posts (Atom)