Last active
January 19, 2018 04:43
-
-
Save anuriq/fa7e99626d18c0fee41c4f12fe97cc03 to your computer and use it in GitHub Desktop.
This file contains 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
codes_file = open('C:\\Users\\udmin\\Documents\\sources.txt') | |
codes_list = codes_file.readlines() | |
codes_list2 = [] | |
for c in codes_list: codes_list2.append(c.split(',')) | |
target_file = open('C:\\Users\\udmin\\Documents\\list.txt') | |
target_list = [x.strip() for x in target_file.readlines()] | |
for target_number in target_list: | |
if target_number: | |
print('Searching code for {}...'.format(target_number)) | |
for row in codes_list2: | |
if int(row[0]) <= int(target_number) and int(target_number) <= int(row[1]): | |
print('Found your code! It is {}'.format(row[2])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment