We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • Hackerrank Home
  • Prepare
    NEW
  • Certify
  • Compete
  • Career Fair
  • Hiring developers?
  1. Prepare
  2. Python
  3. Math
  4. Triangle Quest

Triangle Quest

Problem
Submissions
Leaderboard
Discussions
Editorial

You are given a positive integer . Print a numerical triangle of height like the one below:

1
22
333
4444
55555
......

Can you do it using only arithmetic operations, a single for loop and print statement?

Use no more than two lines. The first line (the for statement) is already written for you. You have to complete the print statement.

Note: Using anything related to strings will give a score of .

Input Format
A single line containing integer, .

Constraints

Output Format
Print lines as explained above.

Sample Input

5

Sample Output

1
22
333
4444

Author

shashank21j

Difficulty

Medium

Cutoff Score

20.00

Max Score

20

Submitted By

125782

Need Help?


View discussions
View editorial
View top submissions

rate this challenge

MORE DETAILS

Download problem statement
Download sample test cases
Suggest Edits
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy
  • Request a Feature