Advertisement
Sterzolg

Conta Parola | Python

Feb 11th, 2014
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  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))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement