Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ef lookForMatch(strn, dct):
- oh_str = ""
- for line in dct:
- if len(strn) > len(line):
- comp_flag = False
- k = 0
- while (len(line) + k <= len(strn)):
- zero_count = strn.count("0")
- for i in range(len(line)):
- if strn[i+k] == line[i] or strn[i+k] == '0':
- if strn[i+k] == "0":
- zero_count -= 1
- oh_str += "0"
- else:
- comp_flag = True
- oh_str += line[i]
- else:
- comp_flag = False
- oh_str = ""
- break
- if comp_flag and not zero_count:
- return (line, oh_str)
- k += 1
- else:
- continue
- return ("NONEXIST", "")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement