Write a python program to count no of ‘p’ in string “ pineapple”
Answers
Answered by
26
Write a python program to count no of ‘p’ in string “ pineapple”
•Program to count no of 'p' in the string pineapple.
•def lettercount( ):
•word = 'pineapple' count = 0 for letter in word:
if letter == 'p' count = cout + 1 print
•('Total no of 'p' in the string pineapple',count)
•Find the errors and output.
•Python Enter an input string A.
Similar questions