I made a multiplication table, but I had to manually type out the code to add to my table. I want to write a loop that does it for me so the multiplication table can go on as long as I tell it too. Right now its limited to how many times i'm willing to write the code.
lista = []
def mult(z):
d = 0
while d < 10:
c = z * d
lista.append(c)
d += 1
x = input("What number?")
mult(x)
table = PrettyTable(["Number", "*", "Equals"])
table.add_row([x, 0, lista[0]])
table.add_row([x, 1, lista[1]])
table.add_row([x, 2, lista[2]])
table.add_row([x, 3, lista[3]])
table.add_row([x, 4, lista[4]])
table.add_row([x, 5, lista[5]])
table.add_row([x, 6, lista[6]])
table.add_row([x, 7, lista[7]])
table.add_row([x, 8, lista[8]])
table.add_row([x, 9, lista[9]])
print table