I am completely new to coding and having just got hold of a Raspberry Pi i am starting out from scratch. Im trying a simple program to display a multiplication table chosen from an input off the user. the entire code is listed below - sorry if its scruffy
The output I'm looking for is for example
1 x 5 = 5
2 x 5 = 10
3 x 5 = 15
etc...
What I actually get is:
(((1, "x"), 5), ' + ') 5)
(((2, "x"), 5), ' + ') 10)
(((3, "x"), 5), ' + ') 15)
etc...
Can anyone help me with a reason as to why this is coming out this way? I appreciate the code may be a little scruffy and bloated. I am trying to use a couple of different methods to set the variables etc just for the sake of experimentation.
thank you in advance Mike
m = int(1)
z = input ("What table would you like to see?")
t = int(z)
while m <13:
e = int(m*t)
sumA = (m, " x ")
sumB = (sumA, t)
sumC = (sumB, " + ")
print (sumC, e)
m += 1
)in your actual output; I'd expect your code to print(((1, "x"), 5), ' + ') 5, not(((1, "x"), 5), ' + ') 5).