Last active
April 11, 2022 13:15
-
-
Save voith/67f567229762ac0e71f59c2c01781bce to your computer and use it in GitHub Desktop.
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 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