In: Computer Science
Important: please use python.
Using while loop, write python code to print the times table (from 0 to 20, incremented by 2) for number 5. Add asterisks (****) so the output looks exactly as shown below. Please send the code and the output of the program.
******************************************************************
This Program Shows Times Table for Number 5 (from 0 to 20) Incremented by 2 *
******************************************************************
0 x 5 = 0
2 x 5 = 10
4 x 5 = 20
6 x 5 = 30
8 x 5 = 40
10 x 5 = 50
12 x 5 = 60
14 x 5 = 70
16 x 5 = 80
18 x 5 = 90
20 x 5 = 100
Python code:
#printing header
print("******************************************************************")
#printing header
print("This Program Shows Times Table for Number 5 (from 0 to 20)
Incremented by 2 *")
#printing header
print("******************************************************************")
#looping from 0 to 20 with Increment 2
for i in range(0,21,2):
#printing the current term
print(str(i)+" x 5 = "+str(i*5))
Screenshot:
Output: