219k views
7 votes
Write a Python program to print the multiplication table of 4​

User Simpatico
by
3.0k points

2 Answers

6 votes

Answer:

Use the code below

13 votes

Answer:

multiplier = 0

while multiplier <= 12:

print(f'4 times {multiplier} = ' + str(4 * multiplier))

multiplier += 1

Step-by-step explanation:

The multiplier is just a variable

while the variable is equal to or less than 12, the program will print "4 times (multiplier value) = (4 times the multiplier value)"

the multiplier value then is increased each time the while loop is completed(which is 12 times)

And when the multiplier value is equal to 12, the program will stop, hope this helps! A simpler version would just be

multiplier = 0

while multiplier <= 12:

print(4 * multiplier)

multiplier += 1

User Jonathan Corwin
by
3.7k points