| author | Anoop Jacob Thomas<anoop@fossee.in> |
| Tue, 12 Oct 2010 17:15:11 +0530 | |
| changeset 309 | 9d8fd5ea64b2 |
| parent 296 | 641a6ee868c0 |
| child 335 | d5248a15274c |
| permissions | -rw-r--r-- |
|
296
641a6ee868c0
made the script writing_python_scripts into new form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
1 |
Creating a tuple:\\ |
|
641a6ee868c0
made the script writing_python_scripts into new form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
2 |
{\ex \lstinline| t = (1, "hello", 2.5)|}
|
|
641a6ee868c0
made the script writing_python_scripts into new form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
3 |
|
|
641a6ee868c0
made the script writing_python_scripts into new form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
4 |
Accessing elements of tuples:\\ |
|
641a6ee868c0
made the script writing_python_scripts into new form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
5 |
{\ex \lstinline| t[index] Ex: t[2]|}
|
|
641a6ee868c0
made the script writing_python_scripts into new form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
6 |
|
|
641a6ee868c0
made the script writing_python_scripts into new form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
7 |
Accessing slices of tuples:\\ |
|
641a6ee868c0
made the script writing_python_scripts into new form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
8 |
{\ex \lstinline| t[start:stop:step]|}
|
|
641a6ee868c0
made the script writing_python_scripts into new form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
9 |
|
|
641a6ee868c0
made the script writing_python_scripts into new form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
10 |
Swapping values:\\ |
|
641a6ee868c0
made the script writing_python_scripts into new form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
11 |
{\ex \lstinline| a, b = b, a|}
|