changeset 237 | 6c203780bfbe |
child 330 | efb8ddf26aff |
236:33828497b5da | 237:6c203780bfbe |
---|---|
1 Creating a tuple:\\ |
|
2 {\ex \lstinline| t = (1, "hello", 2.5)|} |
|
3 |
|
4 Accessing elements of tuples:\\ |
|
5 {\ex \lstinline| t[index] Ex: t[2]|} |
|
6 |
|
7 Accessing slices of tuples:\\ |
|
8 {\ex \lstinline| t[start:stop:step]|} |
|
9 |
|
10 Swapping values:\\ |
|
11 {\ex \lstinline| a, b = b, a|} |