-1

I have one problem in programming.The problem is that I have to give a input of one number and it will print all numbers from that number

Here if i give the input of 3 : Then output will be 123

I wrote a sample code for this:

N=int(input())
for N in range(1,N+1):
    print(N)

It will give output as follows:

1
2
3

To want to give output column wise.So what changes I can do in program to get the output in column.

Patrick Artner
  • 50,409
  • 9
  • 43
  • 69

1 Answers1

0
N = int(input())
for N in range(1, N + 1):
    print(N, end=' ')

the output is:

5
1 2 3 4 5 
jizhihaoSAMA
  • 12,336
  • 9
  • 27
  • 49
Shivam Bharadwaj
  • 1,864
  • 21
  • 23