1#Reverse any python itterable!
2
3# for string
4seq_string = 'Python'
5print(list(reversed(seq_string)))
6
7# for tuple
8seq_tuple = ('P', 'y', 't', 'h', 'o', 'n')
9print(list(reversed(seq_tuple)))
10
11# for range
12seq_range = range(5, 9)
13print(list(reversed(seq_range)))
14
15# for list
16seq_list = [1, 2, 4, 3, 5]
17print(list(reversed(seq_list)))
1arr = [2,5,32,86,4,131,97]
2
3# reverse without modifying input, using range:
4for i in range(len(arr)-1, -1, -1):
5 print(arr[i])
6
7# reverse and modifying input:
8arr.reverse()
9
10