Solution mot commençant par p ou P

# -*- coding: utf-8 -*-
"""
Created on Mon Apr  8 09:20:32 2019

@author: vmahout
"""

import TPTexte


texte = TPTexte.Lire("La maman des poissons.txt")
print(texte)

#RECHERCHE DE MOTS COMMENCANT PAS p ou P
old = 'a'
nombre = 0
for car in texte:
    if ((TPTexte.EstLettre(old) == False) and ((car == 'p') or (car =='P'))) :
        nombre = nombre+1
        print("J'en ai un avec ",car,"et ", old)
    old = car
    
print("Au final j'ai trouvé ",nombre," mots commençant pas p ou P")