adding scripts and names to scripts

This commit is contained in:
Stephen
2021-03-29 13:37:39 -05:00
parent 2485f005af
commit 4b2c0b5b87
12 changed files with 233 additions and 1 deletions

View File

@@ -0,0 +1,21 @@
# used python3
import re
READ = open("pieces.txt", "r")
lines = READ.readlines()
count = 0
for line in lines:
# using regex( findall() )
# to extract words from string
res = re.findall(r'\w+', line)
for word in res:
if(word == "Piece"):
count += 1
print(count)
READ.close()