Skip to content

Instantly share code, notes, and snippets.

@anuriq
Last active January 19, 2018 04:43
Show Gist options
  • Save anuriq/fa7e99626d18c0fee41c4f12fe97cc03 to your computer and use it in GitHub Desktop.
Save anuriq/fa7e99626d18c0fee41c4f12fe97cc03 to your computer and use it in GitHub Desktop.
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