Advertisement
romerlrl

Untitled

Feb 1st, 2020
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. def NovaMsg(string):
  2.     x=(string[0:1] + string[3:4]+string[6:7]).isdigit()
  3.     return x
  4. def conta(caminho):
  5.     tot=0
  6.     caminho = "C:/Users/lucas/Box Sync/CEDERJ/fp python/Whatsapp/input/"+caminho
  7.     with open(caminho, "r", encoding="utf-8") as arquivo:
  8.         for i in arquivo.readlines():
  9.             if NovaMsg(i): tot+=True
  10.     return tot
  11.  
  12. total=conta("jacarelog abriljan.txt")
  13. print(total)
  14. print(conta("janeiro.txt"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement