Sterzolg

Conta Parola | Python

Feb 11th, 2014
107
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. def contaparole(testo, parola):
  3.     count=0    
  4.     testo=testo.split(" ")
  5.    
  6.     for m in testo:
  7.         if parola in m:            
  8.             count=count+1
  9.  
  10.     return count  
  11.        
  12. x = input("inserire testo: ")
  13. y = input("inserire parola da cercare: ")
  14.  
  15. print (contaparole(x,y))
RAW Paste Data