You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
x = list(range(10))
|
|
|
|
print(x[::-1])
|
|
|
|
print(x[::2])
|
|
|
|
print(x[::-2])
|
|
|
|
|
|
|
|
x = list(range(9))
|
|
|
|
print(x[::-1])
|
|
|
|
print(x[::2])
|
|
|
|
print(x[::-2])
|
|
|
|
|
|
|
|
x = list(range(5))
|
|
|
|
print(x[:0:-1])
|
|
|
|
print(x[:1:-1])
|
|
|
|
print(x[:2:-1])
|
|
|
|
print(x[0::-1])
|
|
|
|
print(x[1::-1])
|
|
|
|
print(x[2::-1])
|
|
|
|
|
|
|
|
x = list(range(5))
|
|
|
|
print(x[0:0:-1])
|
|
|
|
print(x[4:4:-1])
|
|
|
|
print(x[5:5:-1])
|
|
|
|
|
|
|
|
x = list(range(10))
|
|
|
|
print(x[-1:-1:-1])
|
|
|
|
print(x[-1:-2:-1])
|
|
|
|
print(x[-1:-11:-1])
|
|
|
|
print(x[-10:-11:-1])
|