Created
June 3, 2021 12:01
-
-
Save FlamptX/3ed5ddeb32eba223ebeeaf55187a65c8 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
def getRootProperty(source, needle): | |
returnable = list(source) | |
sequence = 0 | |
for root in source.items(): | |
for i, j in enumerate(str(root)): | |
try: | |
no_numbers = not str(root)[i - 1].isdigit() and not str(root)[i + 1].isdigit() and str(needle) not in root[0] | |
except IndexError: | |
no_numbers = True | |
if j == str(needle) and no_numbers: | |
print(str(root)) | |
return returnable[sequence] | |
sequence += 1 | |
return False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment