Created
July 2, 2023 11:13
-
-
Save joaofig/427eb0cfff40c1cf5cef9c9aa4f5b411 to your computer and use it in GitHub Desktop.
Generates the list of triples from a token list
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 generate_triples(hex_list: list[int]) -> list[(int,int,int)]: | |
| triples = [] | |
| if len(hex_list) > 2: | |
| for i in range(len(hex_list) - 2): | |
| t0, t1, t2 = hex_list[i:i + 3] | |
| triples.append((t0, t1, t2)) | |
| return triples |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment