python tuple range

Solutions on MaxInterview for python tuple range by the best coders in the world

showing results for - "python tuple range"
Ignacio
05 Apr 2017
1sample = tuple(range(100))
2# beg, end, step (end is not included)
3print(sample[69: 100])  # has numbers in range [69, 99)
4print(sample[2: 68: 2]) # all numbers from 2 to 68 (excluding 68) with step 2
5print(sample[69:]) # from 69 to end
6print(sample[::-1]) # reversed ones