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

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

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

Note that "" represents the consecutive values in between.

Example

Print the string .

Input Format

The first line contains an integer .

Constraints

Output Format

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

Sample Input 0

3

Sample Output 0

123
if __name__ == '__main__':
    n = int(input())
    print(*range(1, n+1), sep='')


Next Post Previous Post
4 Comments
  • Unknown
    Unknown February 27, 2022 at 10:01 PM

    why we use (*) operator with range function.what is the use of this operator?

  • Unknown
    Unknown March 27, 2022 at 7:05 AM

    for delete parentheses and commas

  • brahmaiah
    brahmaiah April 23, 2022 at 5:10 PM

    * will remove initial and end character like [{}]
    sep = '' will remove the spaces between item.

  • Ankur Ranpariya
    Ankur Ranpariya July 12, 2022 at 1:31 PM

    >>> print(range(1,3))
    range(1, 3)
    >>> print(*range(1,3))
    1 2

Add Comment
comment url