• + 4 comments

    n = int(input()) *range (1, n+1) = range is from 1 to n, exclusive of n. so if your input is 3 then it prints 1 2. So input to the range function is 1 to n+1

    if you don't give sep='' in print statement then each value is seperated by a space