diff options
| author | Christian Kolset <christian.kolset@gmail.com> | 2025-04-29 19:02:29 -0600 |
|---|---|---|
| committer | Christian Kolset <christian.kolset@gmail.com> | 2025-04-29 19:02:29 -0600 |
| commit | eb2830349fd1892ec68659c22bab73f26255e268 (patch) | |
| tree | a44991051ad8374f36b8289bf6c45bc4679277cf /book/module1/basics_of_python.tex | |
| parent | d0f224c34e0a0726274c62e9fe66220af6d2e6cc (diff) | |
Fixed minor syntax issues with formating of markdown and latex files
Diffstat (limited to 'book/module1/basics_of_python.tex')
| -rw-r--r-- | book/module1/basics_of_python.tex | 44 |
1 files changed, 29 insertions, 15 deletions
diff --git a/book/module1/basics_of_python.tex b/book/module1/basics_of_python.tex index 4b9db05..a68400e 100644 --- a/book/module1/basics_of_python.tex +++ b/book/module1/basics_of_python.tex @@ -10,26 +10,40 @@ syntax, operators, order or precedence and more. In python \emph{indentations} or the space at the start of each line, signifies a block of code. This becomes important when we start working with function and loops. We will talk more about this in the controls -structures tutorial. \#\#\# Comments Comments can be added to your code -using the hash operator (\#). Any text behind the comment operator till -the end of the line will be rendered as a comment. If you have an entire -block of text or code that needs to be commented out, the triple -quotation marks (``\,``\,``) can be used. Once used all the code after -it will be considered a comment until the comment is ended with the -triple quotation marks.f +structures tutorial. + +\subsubsection{Comments}\label{comments} + +Comments can be added to your code using the hash operator (\#). Any +text behind the comment operator till the end of the line will be +rendered as a comment. If you have an entire block of text or code that +needs to be commented out, the triple quotation marks (``\,``\,``) can +be used. Once used all the code after it will be considered a comment +until the comment is ended with the triple quotation marks.f \subsection{Operators}\label{operators} In python, operators are special symbols or keywords that perform operations on values or variables. This section covers some of the most -common operator that you will see in this course. \#\#\# Arithmetic -operators \textbar{} Operator \textbar{} Name \textbar{} \textbar{} --- -\textbar{} --- \textbar{} \textbar{} + \textbar{} Addition \textbar{} -\textbar{} - \textbar{} Subtraction \textbar{} \textbar{} * \textbar{} -Multiplication \textbar{} \textbar{} / \textbar{} Division \textbar{} -\textbar{} \% \textbar{} Modulus \textbar{} \textbar{} ** \textbar{} -Exponentiation \textbar{} \textbar{} // \textbar{} Floor division -\textbar{} +common operator that you will see in this course. + +\subsubsection{Arithmetic operators}\label{arithmetic-operators} + +\begin{longtable}[]{@{}ll@{}} +\toprule\noalign{} +Operator & Name \\ +\midrule\noalign{} +\endhead +\bottomrule\noalign{} +\endlastfoot ++ & Addition \\ +- & Subtraction \\ +* & Multiplication \\ +/ & Division \\ +\% & Modulus \\ +** & Exponentiation \\ +// & Floor division \\ +\end{longtable} \subsubsection{Comparison operators}\label{comparison-operators} |
