Challenge: Multiplication Table of a Number

In this exercise, you have to print the multiplication table of a number up to 10.

Problem Statement

Write a code which will

  • Print the multiplication table of a number num up to 10.
  • You have to use while loop for solving this problem.
  • Your code should return the string ans with all the values computed from multiplication appended in that string.
    • Here’s a link showing how you can add values to a string.

Input

an integer

Output

a string

Sample Input:

5

Sample Output

Here’s an illustration showing what the string ans should have stored in it at the end of the while loop for the above mentioned input.

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy