Multiplication table in Python using nested for loops and using user input

preview_player
Показать описание
We can fix the number of rows and columns in our multiplication table. These values we can change to increase or decrease the number of multiplications or rows.
We will use one external and one internal for loop to create the multiplication table. External for loop will take care of rows and internal one will generate the columns.
Internal for loop will not have any line break in print command. AT the same time external for loop will have one line break after completion of internal loop.
We will use format() method to assign space to output values.
We can take user input and create the multiplication table, here no need to use nested for loops. Only one loop is enough to create the horizontal table.
Рекомендации по теме