Answer to Question #235951 in Python for saksham

Question #235951

You are given a positive integer N .

Your task is to print a palindromic triangle of size N .

For example, a palindromic triangle of size  is 5:

1
121
12321
1234321
123454321

You can't take more than two lines. The first line (a for-statement) is already written for you.

You have to complete the code using exactly one print statement.



1
Expert's answer
2021-09-12T12:11:38-0400
for n in range(1,int(input("Enter a positive interger: "))+1): 
    print (((10**n - 1)//9)**2)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS