n = int(input("Введіть число: "))
print("\nV1:")
for m in range(1, n + 1):
print(" ".join(reversed([str(n - i) for i in range(m)])))
print("\nV2:")
for m in range(n, 0, -1):
print(" ".join(reversed([str(m - i) for i in range(m)])))
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
n = int(input("Введіть число: "))
print("\nV1:")
for m in range(1, n + 1):
print(" ".join(reversed([str(n - i) for i in range(m)])))
print("\nV2:")
for m in range(n, 0, -1):
print(" ".join(reversed([str(m - i) for i in range(m)])))