Quick Print – CSKC
Sign In

Search

siteicon
Code Learning #PYTHON#10138 Back

Reading Lists and Tuples

Reading methods of lists and tuples are same when read using the index and slice based index method.

Source Code

		 

Run Output

10 20 30 40 50
50 40 30 20 10
[10, 20, 30, 40, 50]
[20, 30, 40, 50]
[10, 20, 30]
[20, 30, 40]
[10, 30, 50]
[50, 40, 30, 20, 10]
A B C
E D C
('A', 'B', 'C', 'D', 'E')
('B', 'C', 'D', 'E')
('A', 'B', 'C')
('B', 'C', 'D')
('A', 'C', 'E')
('E', 'D', 'C', 'B', 'A')