2022-09-19 13:37:26 +00:00
|
|
|
\documentclass[a4paper,10pt]{article}
|
|
|
|
\usepackage{myXsim}
|
2022-09-20 07:24:07 +00:00
|
|
|
\usepackage{minted}
|
2022-09-19 13:37:26 +00:00
|
|
|
|
|
|
|
\author{Benjamin Bertrand}
|
2022-09-20 07:24:07 +00:00
|
|
|
\title{Python et micro:bit - Cours}
|
2022-09-19 13:37:26 +00:00
|
|
|
\date{Septembre 2022}
|
|
|
|
|
|
|
|
\pagestyle{empty}
|
|
|
|
|
|
|
|
\begin{document}
|
|
|
|
|
|
|
|
\maketitle
|
|
|
|
|
2022-09-20 07:24:07 +00:00
|
|
|
\setcounter{section}{1}
|
|
|
|
\section{Corpus élémentaire}
|
2022-09-19 13:37:26 +00:00
|
|
|
|
2022-09-20 07:24:07 +00:00
|
|
|
\subsection{Types de bases}
|
2022-09-19 13:37:26 +00:00
|
|
|
|
2022-09-20 07:24:07 +00:00
|
|
|
Vous serez amené à utiliser essentiellement 4 types de base:
|
2022-09-19 13:37:26 +00:00
|
|
|
|
|
|
|
\begin{center}
|
2022-09-20 07:24:07 +00:00
|
|
|
\begin{tabular}{p{2cm}cccc}
|
|
|
|
Nom & Les entiers signés & Les flottants & Les strings & Les booléens \\
|
|
|
|
Type & int & float & str & bool \\
|
|
|
|
Affectation &
|
|
|
|
\mintinline[bgcolor=base3]{python}{variable = 2} &
|
|
|
|
\mintinline[bgcolor=base3]{python}{variable = 2.2} &
|
|
|
|
\mintinline[bgcolor=base3]{python}{variable = "2"} &
|
|
|
|
\mintinline[bgcolor=base3]{python}{variable = True} \\
|
|
|
|
|
|
|
|
Opérateurs &
|
|
|
|
\texttt{+ - * // \% **}&
|
|
|
|
\texttt{+ - * / **}&
|
|
|
|
\texttt{+ *}&
|
|
|
|
\texttt{or and not} \\
|
2022-09-19 13:37:26 +00:00
|
|
|
\end{tabular}
|
|
|
|
\end{center}
|
|
|
|
|
2022-09-20 07:24:07 +00:00
|
|
|
\textbf{L'affectation}, représenté en python par le symbole \texttt{=}, est l'opération qui va associé
|
2022-09-19 13:37:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\end{document}
|