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.
The solution is following:
n=int(input())
print(*range(1, n+1), sep='')
Here, if we don't use *range & sep='' then the answar will be respectively range(1, 4) & 1 2 3.*range function which takes multiple input arguments & sep='' function call makes sure that there is no space between the values.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Print Function
You are viewing a single comment's thread. Return to all comments →
The solution is following: n=int(input()) print(*range(1, n+1), sep='')
Here, if we don't use *range & sep='' then the answar will be respectively range(1, 4) & 1 2 3.*range function which takes multiple input arguments & sep='' function call makes sure that there is no space between the values.