Created
July 10, 2020 15:01
-
-
Save yum-dev/bb193a3e8a6abb7994c30188474d30e7 to your computer and use it in GitHub Desktop.
get license, police id, challa
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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