Python Print Function - Hacker Rank Solution

Hello coders, today we will be solving Python Print Function Hacker Rank Solution.

Hello coders, today we will be solving Python Print Function Hacker Rank Solution.

Python Print Function

Task

The included code stub will read an integer, n, from STDIN.

Without using any strings methods, try to print the following:

123........n

Note that "....." represents the consecutive values in between.

Example 

n = 5

Print the string 12345.

Input Format

The first line contains an integer n.

Constrains

1 n ≤ 150

Output Format

Print the list of integers from 1 through n as a string, without spaces.

Sample Input 0

3

Sample Output 0

123

Print Function - Hacker Rank Solution

Python 3

if __name__ == '__main__':
    n = int(input())
    for i in range(1, n+1):
        print(i, end="")

print-function-in-python-hackerrank-solution
Print Function in Python - Hacker Rank Solution

Disclaimer: The above problem is generated by Hackerrank but the solution is provided by Sloth Coders. If you have any doubt regarding the problem( Python Print Function ), feel free to contact in the Comment Section.

Happy Coding!!

A Sloth Who loves to code.

Sloth Coders is a Learning Platform for Coders, Programmers and Developers to learn from the basics to advance of Coding of different langauges(python, Java, Javascript and many more).

Post a Comment