diff options
author | Amit Sethi | 2010-11-10 02:12:09 +0530 |
---|---|---|
committer | Amit Sethi | 2010-11-10 02:12:09 +0530 |
commit | c629bdd70767cbf13a293065f9da2537dfd0ef72 (patch) | |
tree | 2571c76da4d04182c2026e2fc8c8ab0fa7b1262b /sets/script.rst | |
parent | eafd0851f1785a5dc6d7922c6cae7df6783a4b68 (diff) | |
parent | dcc19f638a46eec9fe1d9d4879d320057d6bfee5 (diff) | |
download | st-scripts-c629bdd70767cbf13a293065f9da2537dfd0ef72.tar.gz st-scripts-c629bdd70767cbf13a293065f9da2537dfd0ef72.tar.bz2 st-scripts-c629bdd70767cbf13a293065f9da2537dfd0ef72.zip |
Changed in Plotting data and merged heads
Diffstat (limited to 'sets/script.rst')
-rw-r--r-- | sets/script.rst | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/sets/script.rst b/sets/script.rst index 8f9c699..680e170 100644 --- a/sets/script.rst +++ b/sets/script.rst @@ -22,15 +22,15 @@ Script ------ -Hello friends and welcome to the tutorial on Sets - {{{ Show the slide containing title }}} +Hello friends and welcome to the tutorial on Sets + {{{ Show the slide containing the outline slide }}} In this tutorial, we shall learn - * sets + * sets * operations on sets Sets are data structures which contain unique elements. In other words, @@ -40,7 +40,7 @@ Lets look at how to input sets. type :: - a_list = [1, 2, 1, 4, 5, 6, 7] + a_list = [1, 2, 1, 4, 5, 6, 2] a = set(a_list) a @@ -55,7 +55,7 @@ f10 is the set of fibonacci numbers from 1 to 10. p10 is the set of prime numbers from 1 to 10. Various operations that we do on sets are possible here also. -The | character stands for union +The | (pipe) character stands for union :: f10 | p10 @@ -89,19 +89,19 @@ Sets also support checking of subsets. b = set([1, 2]) b < f10 -gives a True since b is a proper subset of f10. +gives a ``True`` since b is a proper subset of f10. Similarly, :: f10 < f10 -gives a False since f10 is not a proper subset. +gives a ``False`` since f10 is not a proper subset. hence the right way to do would be :: f10 <= f10 -and we get a True since every set is a subset of itself. +and we get a ``True`` since every set is a subset of itself. Sets can be iterated upon just like lists and tuples. :: @@ -122,7 +122,7 @@ shows 5. And 1 in f10 2 in f10 -prints True and False respectively +prints ``True`` and ``False`` respectively The order in which elements are organised in a set is not to be relied upon since sets do not support indexing. Hence, slicing and striding are not valid @@ -161,7 +161,6 @@ we have learnt {{{ Show the "sponsored by FOSSEE" slide }}} -#[Nishanth]: Will add this line after all of us fix on one. This tutorial was created as a part of FOSSEE project, NME ICT, MHRD India Hope you have enjoyed and found it useful. |