jonay

buscador de palabras split

Nov 25th, 2014
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.49 KB | None | 0 0
  1. #Buscador de palabra,cualquier duda,mi fb : https://www.facebook.com/TheNinjaBlack2
  2.  
  3.  
  4. import re
  5.  
  6. tipo_de_archivo = input("¿Que archivo deseas abrir?")
  7. tipo_de_palabra = input("¿Que palabra deseas buscar?")
  8.  
  9.  
  10. abrir = open(tipo_de_archivo)
  11.  
  12. abrir2 = abrir.readlines()
  13. lul = 0
  14. for lol in  abrir2:
  15.     ejemplos = lol.split(' ')
  16.     for lel in ejemplos:
  17.         if lel == tipo_de_palabra:
  18.            
  19.             lul = lul + 1
  20.             print ("se encuentra la palabra")
Advertisement
Add Comment
Please, Sign In to add comment