• # Hey Justin, My multiplication table.

I have been playing with python. I bought Craig Benson's book for \$3 on Amazon.

``````print("\t\t\t\t\t" 'multiplication table and 2d array')

for x in range(1, 16):
if x==1:
print("            ",x, end="\t")
else:
print("\t",x, end="\t")
#vertical space
print()
print("_______________________________________________________________________________________________________________________________")

for y in range(1, 16):
for z in range(1, 16):
if z == 1:
print("\t", y, end="\t")
if (y * z)<=99:
print("\t", (y) * (z), end="\t")
else:
print("   ", (y) * (z), end="\t")
print("\n")
`````` I have been looking all over for the best way of moving the title bar over without having many \t

``print("\t\t\t\t\t" 'multiplication table and 2d array')``
• @Michael-McKenney
Python has some builtin utilities for text wrapping. Check out the following built-in module: textwrap

• header_txt = "\tmultiplication table and 2d array"
print(x)

for x in range(1, 16):
if x==1:
print(" ",x, end="\t")
else:
print("\t",x, end="\t")
#horizontal space
print()
print("_______________________________________________________________________________________________________________________________")

for y in range(1, 16):
for z in range(1, 16):
if z == 1:
print("\t", y, end="\t")
if (y * z)<=99:
print("\t", (y) * (z), end="\t")
else:
print(" ", (y) * (z), end="\t")
print("\n")

• This post is deleted!
Posts 4Views 17