Skip to content

Instantly share code, notes, and snippets.

@thomashikaru
Created October 4, 2021 01:18
Show Gist options
  • Save thomashikaru/74eee17e2d6d244bca01fb39f190d571 to your computer and use it in GitHub Desktop.
Save thomashikaru/74eee17e2d6d244bca01fb39f190d571 to your computer and use it in GitHub Desktop.
# without formatter
dictionary = {"a":[1,2,3,4,5,6,7,8,9,8,7,6,5,4,3,2,1], "b":[9,8,7,6,5,4,3,2,1,2,3,4,5,6,7,8,9]}
list_of_items = [f"A: {a}, B: {b}, C: {c}" for a, b, c in itertools.product(range(0,100,2), range(0,100,3), range(0,100,4))]
# with formatter
dictionary = {
"a": [1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 2, 1],
"b": [9, 8, 7, 6, 5, 4, 3, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9],
}
list_of_items = [
f"A: {a}, B: {b}, C: {c}"
for a, b, c in itertools.product(
range(0, 100, 2), range(0, 100, 3), range(0, 100, 4)
)
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment