-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
  • 48,339
  • 8
  • 43
  • 63

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
  • 11,804
  • 9
  • 23
  • 43
Shivam Bharadwaj
  • 1,594
  • 20
  • 20