Question: Python Johnny has been told to write out his times tables, but he would rather code them instead. Write code that will generate the times

Python

Johnny has been told to write out his times tables, but he would rather code them instead. Write code that will generate the times table for whatever integer is passed into the function. The program should calculate the times tables for all numbers from 1 to 10 inclusive. The output of the program when called with 5 should be similar to that below.

Johnny's time tables

The times table for 5 is:

5 x 1 = 5

5 x 2 = 10

5 x 3 = 15

5 x 4 = 20

5 x 5 = 25

5 x 6 = 30

5 x 7 = 35

5 x 8 = 40

5 x 9 = 45

5 x 10 = 50

All output should be displayed together in a single output (which you can either display in the function, or in main when you call the function).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!