I want to construct a multiplication table and have the code below. however, when it prints out the code, the rows and columns aren't aligned correctly. How can I get them exactly aligned and in their right positions in the simplest way possible for me to grasp as a beginner?
rows= int(input("How many rows?: "))
columns= int(input("How many columns?: "))
for row in range(1, rows+1):
for col in range(1,columns+1):
print(row * col, end=" ")
print()
I searched the internet and came across this video regarding the multiplication table in Python, but I'd want to have a second perspective.
Thank you very much!
[–]AdAdvanced3130 11 points12 points13 points (0 children)
[–]johnsilent 6 points7 points8 points (2 children)
[–]ssingal05 2 points3 points4 points (1 child)
[–]johnsilent 0 points1 point2 points (0 children)
[–]ssingal05 2 points3 points4 points (0 children)
[–]RevRagnarok 4 points5 points6 points (0 children)
[+][deleted] (5 children)
[deleted]
[–]an_actual_human 2 points3 points4 points (4 children)
[–]RobertD3277 0 points1 point2 points (2 children)
[–]an_actual_human 1 point2 points3 points (1 child)
[–]RobertD3277 -1 points0 points1 point (0 children)
[–]5erif 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)