Question: Python Given a number N, write a program to print a triangular pattern of N lines with numbers as shown below. Input The input will

Python

 Python Given a number N, write a program to print a

Given a number N, write a program to print a triangular pattern of N lines with numbers as shown below. Input The input will be a single line containing a positive integer (N). Output The output should be N rows with numbers. Note: There is no space between the numbers. Explanation For example, if the given number of rows is 4, your code should print the following pattern 1 121 12321 1234321 Sample Input 1 4 Sample Output 1 1 121 12321 1234321 Sample Input 2 9 Sample Output 2 1 121 12321 1234321 123454321 12345654321 1234567654321 123456787654321 12345678987654321

Given a number N, write a program to print a triangular pattern of N lines with numbers as shown below. Input The input will be a single line containing a positive integer (N). Output The output should be N rows with numbers. Note: There is no space between the numbers. Explanation For example, if the given number of rows is 4, your code should print the following pattern 1 121 12321 1234321 Sample Input 1 4 Sample Output 1 1 121 12321 1234321 Sample Input 2 9 Sample Output 2 1 121 12321 1234321 123454321 12345654321 1234567654321 123456787654321 12345678987654321

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!