CodeTestValidate

No installations needed! Write Python directly in your browser and get instant feedback with our smart validation system.

Challenge # 4

Print Multiplication Table

Objective

Print the multiplication table of a given number from 1 to 10.

Instructions

  • You are given an integer variable n.

  • Print the multiplication table of n from 1 to 10.

  • Each line should be in the format: 'n x i = result'

Constraints:
Do not use input(). • `n` will be a non-negative integer.
Exemple IO

Input: n = 3

Output: 3 x 1 = 3 3 x 2 = 6 3 x 3 = 9 3 x 4 = 12 3 x 5 = 15 3 x 6 = 18 3 x 7 = 21 3 x 8 = 24 3 x 9 = 27 3 x 10 = 30

Input: n = 5

Output: 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

Try It Online!

Output:

Validate Your Results

Get your code reviewed and validated to understand what you did right and where you can improve.

Previous challengeCheck if a Number is Positive, Negative, or ZeroNext challengeCalculate Factorial
Loading...