Skip to content

Instantly share code, notes, and snippets.

@voith
Last active April 11, 2022 13:15
Show Gist options
  • Save voith/67f567229762ac0e71f59c2c01781bce to your computer and use it in GitHub Desktop.
Save voith/67f567229762ac0e71f59c2c01781bce to your computer and use it in GitHub Desktop.
def ones(n):
return sum(10 ** i for i in range(n))
def print_pattern(n):
for i in range(1, n+1):
num = ones(i)
print(" " * (2*(n-i)), end='')
print(f"{num} x {num} = {num * num}", end="\n\n")
print_pattern(9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment