Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1-Write a Python function Multiplication Table() which takes a positive int valu

ID: 3779076 • Letter: 1

Question

1-Write a Python function Multiplication Table() which takes a positive int value n and produce n by n multiplication table on the screen. The function does not return any value. Starter code below. def MultiplicationTable(n); Your code goes here for i in range(5,15,5): MultiplicationTable(i) rin lest mto 1-Numbers must be right justified with column width 5. For this requirement, you must use string formatting covered in the book. 2 Use the starter code to begin with. 3-use either for loops or while loops. 4-Spaces and stars must be printed one at a time. 5-Do not modify the tes_rt0 function. on each row of the triangle, you must draw a number of space(s) first, using a while loop, before star(s). To find an algorithm, you may want to analyze the relationship among the number of spaces, the number of stars, and the row number. The output should be like the output below. 2 2 4 6 8 10 3 3 6 9 12 15 12 16 20 5 5 10 15 20 25 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 2 2 4 6 8 10 12 14 16 18 20 3 3 6 9 12 15 18 21 24 27 30 36 40 16 20 28 5 5 10 15 20 25 30 35 40 45 50 6 6 12 18 24 30 36 42 48 54 60 7 7 14 21 28 35 42 49 56 63 70 8 8 16 24 32 40 48 56 64 72 80 9 9 18 27 36 45 54 63 72 81 90 40 50 60 70 90 100 10 20 30 10

Explanation / Answer

#ask user for input
n=input("Enter the number of rows :")

#doing the multiplication thing here
m = list(list(range(1*i,(n+1)*i, i)) for i in range(1,n+1))

#doing the arrangement of the display
for i in m:
i = [str(j).rjust(len(str(m[-1][-1]))+1) for j in i]
print(''.join(i))