Skip to content

Instantly share code, notes, and snippets.

@prokopevivan
Created February 27, 2023 18:14
Show Gist options
  • Save prokopevivan/1f47d7abb63cc4c52c2361c24edff9e2 to your computer and use it in GitHub Desktop.
Save prokopevivan/1f47d7abb63cc4c52c2361c24edff9e2 to your computer and use it in GitHub Desktop.
def print_operation_table(operation, num_rows=6, num_columns=6):
for x in range(1, num_rows + 1):
nums = []
for y in range(1, num_columns + 1):
num = operation(x, y)
nums.append(num)
print(*[str(x) for x in nums])
print_operation_table(lambda x, y: x * y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment