basic-data-type/quickref.tex
author bhanu
Tue, 16 Nov 2010 23:26:42 +0530
changeset 517 71697b10f4ae
parent 320 223044cf254f
permissions -rw-r--r--
Language check done for `manipulating strings`
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
320
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
     1
\documentclass{article}
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
     2
\begin{Document}
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
     3
\begin{center}
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
     4
\textbf{Basic DataType Quick Reference}\\
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
     5
\end{center}
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
     6
Declaring an Integer:\\
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
     7
{\ex \lstinline|  b=9999999999999999999 |}
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
     8
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
     9
Declaring a float:\\
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    10
{\ex \lstinline|  p=3.141592 |}
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    11
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    12
Declaring a Complex number:\\
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    13
{\ex \lstinline|   c = 3.2+4.6j |}
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    14
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    15
Modulo Operator:\\
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    16
{\ex \lstinline|   87 % 6 |}
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    17
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    18
Exponent Operator:\\
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    19
{\ex \lstinline|   7**8 |}
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    20
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    21
Declaring a list:\\
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    22
{\ex \lstinline|  var_list = [1, 1.2, [1,2]] |}
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    23
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    24
Declaring a string:\\
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    25
{\ex \lstinline| k='Single quote' |}
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    26
{\ex \lstinline| l="Double quote contain's single quote" |}
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    27
{\ex \lstinline| m='''"Contain's both"''' |}
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    28
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    29
Declaring a tuple:\\
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    30
{\ex \lstinline|  var_tup = (1,2,3,4) |}
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    31
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    32
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    33
Accessing Lists, string and tuples:\\
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    34
{\ex \lstinline| seq[-1] |} 
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    35
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    36
Interconversion of number datatype:\\
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    37
{\ex \lstinline| float(2.3+4.2j) |}
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    38
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    39
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    40
Interconversion of sequences:\\
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    41
{\ex \lstinline| tup=tuple([1,2,3,4,5]) |}
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    42
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    43
Spliting string into lists:\\
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    44
{\ex \lstinline| ''split this sting''.split() |}
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    45
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    46
Join lists to create strings:\\
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    47
{\ex \lstinline| ','.join['List','joined','on','commas'] |}
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    48
223044cf254f Adding new format st-scripts with questions etc for basic-data-type and
amit
parents:
diff changeset
    49
\end{Document}