Example 1 — Walk the letter codes with range
Row 1 prints one code. Each later row includes one more, because range stops at start + row.
rows = 5
start = ord('A')
for row in range(1, rows + 1):
for code in range(start, start + row):
print(chr(code), end="")
print() How It Works
ord('A')is 65.chrturns each later code back into a letter.end=""keeps those letters on one row.- Bare
print()after the inner loop starts the next row.

