- 1
Alternate code to give same output as my following code .
list_1=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10] x,y=map(int,input().split()) list_2=list_1[x:y] for i in list_2: print(i)
4 Respostas
+ 2
x,y=(int(i) for i in input().split())
+ 1
Rough one-liner
print("\n".join((lambda inp: [str(i) for i in range(1,11)[int(inp[0]): int(inp[1])]])(input().split())))
+ 1
print(list_1[slice(*map(int, input().split()))])
https://code.sololearn.com/cKPnyIph8qwI/?ref=app
+ 1
thanks everyone for helping me better my understanding