sets/quickref.tex
author Anoop Jacob Thomas<anoop@fossee.in>
Sat, 18 Dec 2010 12:54:49 +0530
changeset 524 b602b4dcc87d
parent 523 54bdda4aefa5
permissions -rw-r--r--
Made some changes to the script embellishing a plot, but it still needs changes.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
333
91b427241f8f Finished sets
Nishanth <nishanth@fossee.in>
parents: 233
diff changeset
     1
Creating a set:\\
91b427241f8f Finished sets
Nishanth <nishanth@fossee.in>
parents: 233
diff changeset
     2
{\ex \lstinline|   p10 = set([2, 3, 5, 7]) |t}
233
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
     3
333
91b427241f8f Finished sets
Nishanth <nishanth@fossee.in>
parents: 233
diff changeset
     4
Creating set from a tuple or list:\\
91b427241f8f Finished sets
Nishanth <nishanth@fossee.in>
parents: 233
diff changeset
     5
{\ex \lstinline|   s = set(var_name)|}
91b427241f8f Finished sets
Nishanth <nishanth@fossee.in>
parents: 233
diff changeset
     6
91b427241f8f Finished sets
Nishanth <nishanth@fossee.in>
parents: 233
diff changeset
     7
Operations on sets. Ex: UNION:\\
91b427241f8f Finished sets
Nishanth <nishanth@fossee.in>
parents: 233
diff changeset
     8
{\ex \lstinline|   s1 \| s2 |}
91b427241f8f Finished sets
Nishanth <nishanth@fossee.in>
parents: 233
diff changeset
     9
91b427241f8f Finished sets
Nishanth <nishanth@fossee.in>
parents: 233
diff changeset
    10
Other operations available:\\
233
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    11
523
54bdda4aefa5 Renamed some LOs and other minor corrections.
Puneeth Chaganti <punchagan@fossee.in>
parents: 333
diff changeset
    12
\begin{lstlisting}
333
91b427241f8f Finished sets
Nishanth <nishanth@fossee.in>
parents: 233
diff changeset
    13
\item "\&" -- Intersection
91b427241f8f Finished sets
Nishanth <nishanth@fossee.in>
parents: 233
diff changeset
    14
\item "-" -- Difference
91b427241f8f Finished sets
Nishanth <nishanth@fossee.in>
parents: 233
diff changeset
    15
\item "\^" -- Symmetric Difference
91b427241f8f Finished sets
Nishanth <nishanth@fossee.in>
parents: 233
diff changeset
    16
\item "<" -- Subset
91b427241f8f Finished sets
Nishanth <nishanth@fossee.in>
parents: 233
diff changeset
    17
\end{lstlisting}
233
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    18
333
91b427241f8f Finished sets
Nishanth <nishanth@fossee.in>
parents: 233
diff changeset
    19
Checking for containership:\\
91b427241f8f Finished sets
Nishanth <nishanth@fossee.in>
parents: 233
diff changeset
    20
{\ex \lstinline|    x in p10|}
91b427241f8f Finished sets
Nishanth <nishanth@fossee.in>
parents: 233
diff changeset
    21
91b427241f8f Finished sets
Nishanth <nishanth@fossee.in>
parents: 233
diff changeset
    22
Finding the no.of elements:\\
91b427241f8f Finished sets
Nishanth <nishanth@fossee.in>
parents: 233
diff changeset
    23
{\ex \lstinline|    len(p10)|}