Computer Science, asked by playgame70264, 3 months ago

Write a python program to count no of ‘p’ in string “ pineapple”​

Answers

Answered by shriyathakur423
26

{\bf{\underline{\underline \purple{ Question }}}}

Write a python program to count no of ‘p’ in string “ pineapple”

{\bf{\underline{\underline \blue{ Answer }}}}

•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.

\fbox \red{ Hope this will help you }

Similar questions