Skip to content

Instantly share code, notes, and snippets.

@yum-dev
Created July 10, 2020 15:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yum-dev/bb193a3e8a6abb7994c30188474d30e7 to your computer and use it in GitHub Desktop.
Save yum-dev/bb193a3e8a6abb7994c30188474d30e7 to your computer and use it in GitHub Desktop.
get license, police id, challa
def text():
"""
Process the input text file
Returns:
list: list of all the license numbers
"""
licence_number = []
with open('inputPS11.txt') as f:
for line in f:
tokens = line.split(' / ')
# policeID = tokens[0]
lic_no = tokens[1]
# fine_amount = tokens[2]
licence_number.append([lic_no])
licenses = [item for sublist in licence_number for item in sublist]
return licenses
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment