QCM C1
This commit is contained in:
parent
3ad9ff1140
commit
eb3c7313c5
199 changed files with 10833 additions and 0 deletions
BIN
C1/C1.pdf
Normal file
BIN
C1/C1.pdf
Normal file
Binary file not shown.
342
C1/c1.html
Normal file
342
C1/c1.html
Normal file
|
|
@ -0,0 +1,342 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="fr"><head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<link rel="stylesheet" href="c1_fichiers/github.css">
|
||||||
|
<link rel="stylesheet" href="c1_fichiers/style.css">
|
||||||
|
<script src="c1_fichiers/highlight.pack.js"></script>
|
||||||
|
<script>
|
||||||
|
hljs.highlightAll();
|
||||||
|
</script>
|
||||||
|
<title>BNS première NSI</title>
|
||||||
|
<style>:is([id*='google_ads_iframe'],[id*='taboola-'],.taboolaHeight,.taboola-placeholder,#top-ad,#credential_picker_container,#credentials-picker-container,#credential_picker_iframe,[id*='google-one-tap-iframe'],#google-one-tap-popup-container,.google-one-tap__module,.google-one-tap-modal-div,#amp_floatingAdDiv,#ez-content-blocker-container) {display:none!important;min-height:0!important;height:0!important;}</style></head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<header>
|
||||||
|
<nav>
|
||||||
|
<img src="c1_fichiers/menu.svg">
|
||||||
|
</nav>
|
||||||
|
<h2>BNS PREMIERE NSI</h2>
|
||||||
|
</header>
|
||||||
|
<aside>
|
||||||
|
<ul>
|
||||||
|
<li><a href="https://pixees.fr/informatiquelycee/prem/bns/bns_c1.html">CHAPITRE 1</a></li>
|
||||||
|
<li><a href="https://pixees.fr/informatiquelycee/prem/bns/bns_c2.html">CHAPITRE 2</a></li>
|
||||||
|
<li><a href="https://pixees.fr/informatiquelycee/prem/bns/bns_c3.html">CHAPITRE 3</a></li>
|
||||||
|
<li><a href="https://pixees.fr/informatiquelycee/prem/bns/bns_c4.html">CHAPITRE 4</a></li>
|
||||||
|
<li><a href="https://pixees.fr/informatiquelycee/prem/bns/bns_c5.html">CHAPITRE 5</a></li>
|
||||||
|
<li><a href="https://pixees.fr/informatiquelycee/prem/bns/bns_c6.html">CHAPITRE 6</a></li>
|
||||||
|
<li><a href="https://pixees.fr/informatiquelycee/prem/bns/bns_c7.html">CHAPITRE 7</a></li>
|
||||||
|
<li><a href="https://pixees.fr/informatiquelycee/prem/bns/bns_c8.html">CHAPITRES 8 et 9</a></li>
|
||||||
|
<li><a href="https://pixees.fr/informatiquelycee/prem/bns/bns_c14.html">CHAPITRES 13 et 14</a></li>
|
||||||
|
<li><a href="https://pixees.fr/informatiquelycee/prem/bns/bns_c15.html">CHAPITRE 15</a></li>
|
||||||
|
<li><a href="https://pixees.fr/informatiquelycee/prem/bns/bns_c20.html">CHAPITRES 16, 17, 18, 19 et 20</a></li>
|
||||||
|
<li><a href="https://pixees.fr/informatiquelycee/prem/bns/bns_c28.html">CHAPITRES 21, 22, 23, 24, 25, 26, 27 et 28</a></li>
|
||||||
|
<li><a href="https://pixees.fr/informatiquelycee/prem/bns/bns_c29.html">CHAPITRE 29</a></li>
|
||||||
|
<li><a href="https://pixees.fr/informatiquelycee/prem/bns/bns_c32.html">CHAPITRES 10, 11, 12, 30, 31 et 32</a></li>
|
||||||
|
<li><a href="https://pixees.fr/informatiquelycee/prem/bns/bns_c33.html">CHAPITRE 33</a></li>
|
||||||
|
</ul>
|
||||||
|
</aside>
|
||||||
|
<div class="content">
|
||||||
|
<h2>QUESTIONS CHAPITRE 1</h2>
|
||||||
|
<p>
|
||||||
|
Q1 - Parmi les quatre expressions suivantes, laquelle s'évalue en True ?
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Réponses :
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
A- False and (True and False)
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
B- False or (True and False)
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
C- True and (True and False)
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<span class="ok"> D- True or (True and False)</span>
|
||||||
|
</p>
|
||||||
|
<hr>
|
||||||
|
<p>
|
||||||
|
Q2 - Si a vaut False et b vaut True, que vaut l’expression booléenne NOT(a AND b) ?
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Réponses :
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
A- 0
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
B- False
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<span class="ok">C- True</span>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
D- None
|
||||||
|
</p>
|
||||||
|
<hr>
|
||||||
|
<p>
|
||||||
|
Q3 - On exécute le code suivant
|
||||||
|
</p>
|
||||||
|
<pre><code class="python hljs">
|
||||||
|
a = <span class="hljs-number">2</span>
|
||||||
|
b = <span class="hljs-number">3</span>
|
||||||
|
c = a ** b
|
||||||
|
d = c % b
|
||||||
|
</code></pre>
|
||||||
|
<p>
|
||||||
|
Quelle est la valeur de d à la fin de l'exécution ?
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Réponses :
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
A- 1
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<span class="ok">B- 2</span>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
C- 3
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
D- 4
|
||||||
|
</p>
|
||||||
|
<hr>
|
||||||
|
<p>
|
||||||
|
Q4 - La variable x contient la valeur 3, la variable y contient la variable 4.
|
||||||
|
Quelle expression s'évalue en True parmi les quatre propositions suivantes ?
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Réponses :
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<span class="ok">A- x == 3 or y == 5</span>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
B- x == 3 and y == 5
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
C- x != 3 or y == 5
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
D- y < 4
|
||||||
|
</p>
|
||||||
|
<hr>
|
||||||
|
<p>
|
||||||
|
Q5 - À quelle affectation sont équivalentes les instructions
|
||||||
|
suivantes, où a, b sont des variables entières et c une variable
|
||||||
|
booléenne ?
|
||||||
|
</p>
|
||||||
|
<pre><code class="python hljs">
|
||||||
|
<span class="hljs-keyword">if</span> a==b:
|
||||||
|
c = <span class="hljs-literal">True</span>
|
||||||
|
<span class="hljs-keyword">elif</span> a > b+<span class="hljs-number">10</span>:
|
||||||
|
c = <span class="hljs-literal">True</span>
|
||||||
|
<span class="hljs-keyword">else</span>:
|
||||||
|
c = <span class="hljs-literal">False</span>
|
||||||
|
</code></pre>
|
||||||
|
<p>
|
||||||
|
Réponses :
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<span class="ok">A- c = (a==b) or (a > b+10)</span>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
B- c = (a==b) and (a > b+10)
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
C- c = not(a==b)
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
D- c = not(a > b+10)
|
||||||
|
</p>
|
||||||
|
<hr>
|
||||||
|
<p>
|
||||||
|
Q6 - Sachant que l'expression not(a or b) a la valeur True,
|
||||||
|
quelles peuvent être les valeurs des variables booléennes a et b ?
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Réponses :
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
A- True et True
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
B- False et True
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
C- True et False
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<span class="ok">D- False et False</span>
|
||||||
|
</p>
|
||||||
|
<hr>
|
||||||
|
<p>
|
||||||
|
Q7 - On considère une formule booléenne form des variables booléennes a et b dont voici la table de vérité.
|
||||||
|
</p>
|
||||||
|
<table>
|
||||||
|
<tbody><tr>
|
||||||
|
<th>a</th>
|
||||||
|
<th>b</th>
|
||||||
|
<th>form</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>True</td>
|
||||||
|
<td>True</td>
|
||||||
|
<td>False</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>False</td>
|
||||||
|
<td>True</td>
|
||||||
|
<td>False</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>True</td>
|
||||||
|
<td>False</td>
|
||||||
|
<td>True</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>False</td>
|
||||||
|
<td>False</td>
|
||||||
|
<td>False</td>
|
||||||
|
</tr>
|
||||||
|
</tbody></table>
|
||||||
|
<p>
|
||||||
|
Quelle est cette formule booléenne form ?
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Réponses :
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
A- a and b
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
B- a or b
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<span class="ok">C- a and not(b)</span>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
D- not(a) or b
|
||||||
|
</p>
|
||||||
|
<hr>
|
||||||
|
<p>
|
||||||
|
Q8 - Pour quelles valeurs booléennes des variables a, b et c
|
||||||
|
l'expression (a or b) and (not c) a-t-elle pour valeur True ?
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Réponses :
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
A- a = True b = False c = True
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<span class="ok">B- a = True b = False c = False</span>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
C- a = False b = False c = True
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
D- a = False b = True c = True
|
||||||
|
</p>
|
||||||
|
<hr>
|
||||||
|
<p>
|
||||||
|
Q9 - Soient a et b deux booléens. L’expression booléenne NOT(a AND b) OR a est équivalente à :
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Réponses :
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
A- False
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<span class="ok">B- True</span>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
C- NOT(b)
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
D- NOT(a) OR NOT(b)
|
||||||
|
</p>
|
||||||
|
<hr>
|
||||||
|
<p>
|
||||||
|
Q10 - Si A et B sont des variables booléennes, laquelle de ces expressions booléennes est équivalente
|
||||||
|
à (not A) or B ?
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Réponses :
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
A- (A and B) or (not A and B)
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<span class="ok">B- (A and B) or (not A and B) or (not A and not B)</span>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
C- (not A and B) or (not A and not B)
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
D- (A and B) or (not A and not B)
|
||||||
|
</p>
|
||||||
|
<hr>
|
||||||
|
<p>
|
||||||
|
Q11 - On considère l'extrait de code suivant :
|
||||||
|
</p>
|
||||||
|
<pre><code class="python hljs">
|
||||||
|
<span class="hljs-keyword">while</span> (a < <span class="hljs-number">20</span>) <span class="hljs-keyword">or</span> (b > <span class="hljs-number">50</span>):
|
||||||
|
......
|
||||||
|
......
|
||||||
|
</code></pre>
|
||||||
|
<p>
|
||||||
|
Quelles conditions permettent de mettre fin à cette boucle ?
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Réponses :
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
A- la boucle prend fin lorsque a < 20 ou b >50
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
B- la boucle prend fin lorsque a < 20 et b > 50
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
C- la boucle prend fin lorsque a >= 20 ou b <= 50 </p>
|
||||||
|
<p>
|
||||||
|
<span class="ok">D- la boucle prend fin lorsque a >= 20 et b <= 50</span>
|
||||||
|
</p>
|
||||||
|
<hr>
|
||||||
|
<p>
|
||||||
|
Q12 - Quelle est la valeur de x à la fin de l'exécution du script Python suivant ?
|
||||||
|
</p>
|
||||||
|
<pre><code class="python hljs">
|
||||||
|
x = <span class="hljs-number">1</span>
|
||||||
|
<span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(<span class="hljs-number">10</span>):
|
||||||
|
x = x * <span class="hljs-number">2</span>
|
||||||
|
</code></pre>
|
||||||
|
<p>
|
||||||
|
Réponses :
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
A- 2
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<span class="ok">B- 1024</span>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
C- 2048
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
D- 20000000000
|
||||||
|
</p>
|
||||||
|
<hr>
|
||||||
|
</div>
|
||||||
|
<script src="c1_fichiers/script.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</body></html>
|
||||||
201
C1/c1.tex
Normal file
201
C1/c1.tex
Normal file
|
|
@ -0,0 +1,201 @@
|
||||||
|
% Questions générées automatiquement
|
||||||
|
|
||||||
|
\element{C1}{
|
||||||
|
\begin{question}{q1}
|
||||||
|
|
||||||
|
Parmi les quatre expressions suivantes, laquelle s'évalue en True ?
|
||||||
|
|
||||||
|
\begin{multicols}{2}
|
||||||
|
\begin{reponses}
|
||||||
|
\mauvaise{False and (True and False)}
|
||||||
|
\mauvaise{False or (True and False)}
|
||||||
|
\mauvaise{True and (True and False)}
|
||||||
|
\bonne{True or (True and False)}
|
||||||
|
\end{reponses}
|
||||||
|
\end{multicols}
|
||||||
|
\end{question}
|
||||||
|
}
|
||||||
|
|
||||||
|
\element{C1}{
|
||||||
|
\begin{question}{q2}
|
||||||
|
|
||||||
|
Si a vaut False et b vaut True, que vaut l’expression booléenne NOT(a AND b) ?
|
||||||
|
|
||||||
|
\begin{multicols}{4}
|
||||||
|
\begin{reponses}
|
||||||
|
\mauvaise{0}
|
||||||
|
\mauvaise{False}
|
||||||
|
\bonne{True}
|
||||||
|
\mauvaise{None}
|
||||||
|
\end{reponses}
|
||||||
|
\end{multicols}
|
||||||
|
\end{question}
|
||||||
|
}
|
||||||
|
|
||||||
|
\element{C1}{
|
||||||
|
\begin{question}{q3}
|
||||||
|
|
||||||
|
On exécute le code suivant
|
||||||
|
|
||||||
|
%\inputminted[xleftmargin=20pt,linenos]{python}{codes/q3_1.py}
|
||||||
|
\pyfichier{codes/q3_1.py}
|
||||||
|
Quelle est la valeur de d à la fin de l'exécution ?
|
||||||
|
|
||||||
|
\begin{multicols}{4}
|
||||||
|
\begin{reponses}
|
||||||
|
\mauvaise{1}
|
||||||
|
\bonne{2}
|
||||||
|
\mauvaise{3}
|
||||||
|
\mauvaise{4}
|
||||||
|
\end{reponses}
|
||||||
|
\end{multicols}
|
||||||
|
\end{question}
|
||||||
|
}
|
||||||
|
|
||||||
|
\element{C1}{
|
||||||
|
\begin{question}{q4}
|
||||||
|
|
||||||
|
La variable x contient la valeur 3, la variable y contient la variable 4. Quelle expression s'évalue en True parmi les quatre propositions suivantes ?
|
||||||
|
|
||||||
|
\begin{multicols}{2}
|
||||||
|
\begin{reponses}
|
||||||
|
\bonne{x == 3 or y == 5}
|
||||||
|
\mauvaise{x == 3 and y == 5}
|
||||||
|
\mauvaise{x != 3 or y == 5}
|
||||||
|
\mauvaise{y < 4}
|
||||||
|
\end{reponses}
|
||||||
|
\end{multicols}
|
||||||
|
\end{question}
|
||||||
|
}
|
||||||
|
|
||||||
|
\element{C1}{
|
||||||
|
\begin{question}{q5}
|
||||||
|
|
||||||
|
À quelle affectation sont équivalentes les instructions suivantes, où a, b sont des variables entières et c une variable booléenne ?
|
||||||
|
|
||||||
|
\pyfichier{codes/q5_2.py}
|
||||||
|
|
||||||
|
\begin{multicols}{2}
|
||||||
|
\begin{reponses}
|
||||||
|
\bonne{c = (a==b) or (a > b+10)}
|
||||||
|
\mauvaise{c = (a==b) and (a > b+10)}
|
||||||
|
\mauvaise{c = not(a==b)}
|
||||||
|
\mauvaise{c = not(a > b+10)}
|
||||||
|
\end{reponses}
|
||||||
|
\end{multicols}
|
||||||
|
\end{question}
|
||||||
|
}
|
||||||
|
|
||||||
|
\element{C1}{
|
||||||
|
\begin{question}{q6}
|
||||||
|
|
||||||
|
Sachant que l'expression not(a or b) a la valeur True, quelles peuvent être les valeurs des variables booléennes a et b ?
|
||||||
|
|
||||||
|
\begin{multicols}{2}
|
||||||
|
\begin{reponses}
|
||||||
|
\mauvaise{True et True}
|
||||||
|
\mauvaise{False et True}
|
||||||
|
\mauvaise{True et False}
|
||||||
|
\bonne{False et False}
|
||||||
|
\end{reponses}
|
||||||
|
\end{multicols}
|
||||||
|
\end{question}
|
||||||
|
}
|
||||||
|
|
||||||
|
\element{C1}{
|
||||||
|
\begin{question}{q7}
|
||||||
|
|
||||||
|
On considère une formule booléenne form des variables booléennes a et b dont voici la table de vérité.
|
||||||
|
|
||||||
|
Quelle est cette formule booléenne form ?
|
||||||
|
|
||||||
|
\begin{multicols}{4}
|
||||||
|
\begin{reponses}
|
||||||
|
\mauvaise{a and b}
|
||||||
|
\mauvaise{a or b}
|
||||||
|
\bonne{a and not(b)}
|
||||||
|
\mauvaise{not(a) or b}
|
||||||
|
\end{reponses}
|
||||||
|
\end{multicols}
|
||||||
|
\end{question}
|
||||||
|
}
|
||||||
|
|
||||||
|
\element{C1}{
|
||||||
|
\begin{question}{q8}
|
||||||
|
|
||||||
|
Pour quelles valeurs booléennes des variables a, b et c l'expression (a or b) and (not c) a-t-elle pour valeur True ?
|
||||||
|
|
||||||
|
\begin{reponses}
|
||||||
|
\mauvaise{a = True b = False c = True}
|
||||||
|
\bonne{a = True b = False c = False}
|
||||||
|
\mauvaise{a = False b = False c = True}
|
||||||
|
\mauvaise{a = False b = True c = True}
|
||||||
|
\end{reponses}
|
||||||
|
\end{question}
|
||||||
|
}
|
||||||
|
|
||||||
|
\element{C1}{
|
||||||
|
\begin{question}{q9}
|
||||||
|
|
||||||
|
Soient a et b deux booléens. L’expression booléenne NOT(a AND b) OR a est équivalente à :
|
||||||
|
|
||||||
|
\begin{multicols}{2}
|
||||||
|
\begin{reponses}
|
||||||
|
\mauvaise{False}
|
||||||
|
\bonne{True}
|
||||||
|
\mauvaise{NOT(b)}
|
||||||
|
\mauvaise{NOT(a) OR NOT(b)}
|
||||||
|
\end{reponses}
|
||||||
|
\end{multicols}
|
||||||
|
\end{question}
|
||||||
|
}
|
||||||
|
|
||||||
|
\element{C1}{
|
||||||
|
\begin{question}{q10}
|
||||||
|
|
||||||
|
Si A et B sont des variables booléennes, laquelle de ces expressions booléennes est équivalente à (not A) or B ?
|
||||||
|
|
||||||
|
\begin{reponses}
|
||||||
|
\mauvaise{(A and B) or (not A and B)}
|
||||||
|
\bonne{(A and B) or (not A and B) or (not A and not B)}
|
||||||
|
\mauvaise{(not A and B) or (not A and not B)}
|
||||||
|
\mauvaise{(A and B) or (not A and not B)}
|
||||||
|
\end{reponses}
|
||||||
|
\end{question}
|
||||||
|
}
|
||||||
|
|
||||||
|
\element{C1}{
|
||||||
|
\begin{question}{q11}
|
||||||
|
|
||||||
|
On considère l'extrait de code suivant :
|
||||||
|
|
||||||
|
\pyfichier{codes/q11_3.py}
|
||||||
|
|
||||||
|
Quelles conditions permettent de mettre fin à cette boucle ?
|
||||||
|
|
||||||
|
\begin{reponses}
|
||||||
|
\mauvaise{la boucle prend fin lorsque a 50}
|
||||||
|
\mauvaise{la boucle prend fin lorsque a 50}
|
||||||
|
\mauvaise{la boucle prend fin lorsque a >= 20 ou b <= 50}
|
||||||
|
\bonne{la boucle prend fin lorsque a >= 20 et b <= 50}
|
||||||
|
\end{reponses}
|
||||||
|
\end{question}
|
||||||
|
}
|
||||||
|
|
||||||
|
\element{C1}{
|
||||||
|
\begin{question}{q12}
|
||||||
|
|
||||||
|
Quelle est la valeur de x à la fin de l'exécution du script Python suivant ?
|
||||||
|
|
||||||
|
\pyfichier{codes/q12_4.py}
|
||||||
|
|
||||||
|
\begin{multicols}{2}
|
||||||
|
\begin{reponses}
|
||||||
|
\mauvaise{2}
|
||||||
|
\bonne{1024}
|
||||||
|
\mauvaise{2048}
|
||||||
|
\mauvaise{20000000000}
|
||||||
|
\end{reponses}
|
||||||
|
\end{multicols}
|
||||||
|
\end{question}
|
||||||
|
}
|
||||||
99
C1/c1_fichiers/github.css
Normal file
99
C1/c1_fichiers/github.css
Normal file
|
|
@ -0,0 +1,99 @@
|
||||||
|
/*
|
||||||
|
|
||||||
|
github.com style (c) Vasily Polovnyov <vast@whiteants.net>
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
.hljs {
|
||||||
|
display: block;
|
||||||
|
overflow-x: auto;
|
||||||
|
padding: 0.5em;
|
||||||
|
color: #333;
|
||||||
|
background: #f8f8f8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-comment,
|
||||||
|
.hljs-quote {
|
||||||
|
color: #998;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-keyword,
|
||||||
|
.hljs-selector-tag,
|
||||||
|
.hljs-subst {
|
||||||
|
color: #333;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-number,
|
||||||
|
.hljs-literal,
|
||||||
|
.hljs-variable,
|
||||||
|
.hljs-template-variable,
|
||||||
|
.hljs-tag .hljs-attr {
|
||||||
|
color: #008080;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-string,
|
||||||
|
.hljs-doctag {
|
||||||
|
color: #d14;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-title,
|
||||||
|
.hljs-section,
|
||||||
|
.hljs-selector-id {
|
||||||
|
color: #900;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-subst {
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-type,
|
||||||
|
.hljs-class .hljs-title {
|
||||||
|
color: #458;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-tag,
|
||||||
|
.hljs-name,
|
||||||
|
.hljs-attribute {
|
||||||
|
color: #000080;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-regexp,
|
||||||
|
.hljs-link {
|
||||||
|
color: #009926;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-symbol,
|
||||||
|
.hljs-bullet {
|
||||||
|
color: #990073;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-built_in,
|
||||||
|
.hljs-builtin-name {
|
||||||
|
color: #0086b3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-meta {
|
||||||
|
color: #999;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-deletion {
|
||||||
|
background: #fdd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-addition {
|
||||||
|
background: #dfd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-emphasis {
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-strong {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
667
C1/c1_fichiers/highlight.pack.js
Normal file
667
C1/c1_fichiers/highlight.pack.js
Normal file
File diff suppressed because one or more lines are too long
1
C1/c1_fichiers/menu.svg
Normal file
1
C1/c1_fichiers/menu.svg
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#FFFFFF"><path d="M0 0h24v24H0z" fill="none"/><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/></svg>
|
||||||
|
After Width: | Height: | Size: 202 B |
30
C1/c1_fichiers/script.js
Normal file
30
C1/c1_fichiers/script.js
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
const menu = document.querySelector("header nav img")
|
||||||
|
const aside = document.querySelector("aside")
|
||||||
|
const content = document.querySelector(".content")
|
||||||
|
|
||||||
|
let toggle = false;
|
||||||
|
|
||||||
|
menu.addEventListener('click', () => {
|
||||||
|
toggle = !toggle
|
||||||
|
console.log('clic')
|
||||||
|
if (toggle) {
|
||||||
|
aside.classList.add('show_aside')
|
||||||
|
aside.classList.remove('hidden_aside')
|
||||||
|
} else {
|
||||||
|
aside.classList.add('hidden_aside')
|
||||||
|
aside.classList.remove('show_aside')
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
if (content != null) {
|
||||||
|
content.addEventListener('click', () => {
|
||||||
|
if (toggle) {
|
||||||
|
toggle = false
|
||||||
|
aside.classList.add('hidden_aside')
|
||||||
|
aside.classList.remove('show_aside')
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
338
C1/c1_fichiers/style.css
Normal file
338
C1/c1_fichiers/style.css
Normal file
|
|
@ -0,0 +1,338 @@
|
||||||
|
@font-face {
|
||||||
|
font-family: "input";
|
||||||
|
src: url("fonts/InputMonoNarrow-Light.ttf");
|
||||||
|
}
|
||||||
|
|
||||||
|
* {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
font-family: Helvetica, Georgia, sans-serif;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
background-color: rgb(255, 255, 255);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************header+aside****************************************/
|
||||||
|
header {
|
||||||
|
background-color: #424242;
|
||||||
|
position: fixed;
|
||||||
|
width: 100%;
|
||||||
|
height: 60px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
color: white;
|
||||||
|
z-index: 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
header nav {
|
||||||
|
margin-left: 40px;
|
||||||
|
width: 10%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
list-style: none;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width:800px) {
|
||||||
|
header h2 {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
header h3 {
|
||||||
|
font-size: 1rem;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
header nav {
|
||||||
|
width: 50%
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
header nav img {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
header h2 {
|
||||||
|
margin-right: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width:800px) {
|
||||||
|
.content {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
aside {
|
||||||
|
position: fixed;
|
||||||
|
top: 60px;
|
||||||
|
left: -300px;
|
||||||
|
width: 300px;
|
||||||
|
background-color: rgba(7, 7, 7, 0.8);
|
||||||
|
list-style: none;
|
||||||
|
height: 100vh;
|
||||||
|
overflow-y: scroll;
|
||||||
|
list-style: none;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
aside>ul {
|
||||||
|
padding-top: 30px;
|
||||||
|
padding-bottom: 70px;
|
||||||
|
padding-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
aside ul {
|
||||||
|
list-style: none;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
aside ul li ul {
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
aside a {
|
||||||
|
display: inline-block;
|
||||||
|
color: rgb(200, 200, 200);
|
||||||
|
margin: 5px;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
aside::-webkit-scrollbar {
|
||||||
|
background: #000;
|
||||||
|
width: 10px;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
aside:hover::-webkit-scrollbar {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
aside::-webkit-scrollbar-thumb {
|
||||||
|
background-color: #838383;
|
||||||
|
}
|
||||||
|
|
||||||
|
aside::-webkit-scrollbar-thumb:hover {
|
||||||
|
background-color: #bbbbbb;
|
||||||
|
}
|
||||||
|
|
||||||
|
aside ul li a:hover {
|
||||||
|
color: rgb(110, 110, 110);
|
||||||
|
}
|
||||||
|
|
||||||
|
.show_aside {
|
||||||
|
transform: translateX(300px);
|
||||||
|
transition-property: transform;
|
||||||
|
transition-duration: 1s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hidden_aside {
|
||||||
|
transform: translateX(0px);
|
||||||
|
transition-property: transform;
|
||||||
|
transition-duration: 1s;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*********************fin header+aside***********************************/
|
||||||
|
|
||||||
|
/***********************content**************************************/
|
||||||
|
.content_title {
|
||||||
|
min-height: 100vh;
|
||||||
|
width: 100%;
|
||||||
|
margin: 0 auto;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content_title h1 {
|
||||||
|
|
||||||
|
color: black;
|
||||||
|
text-transform: uppercase;
|
||||||
|
font-size: 5rem;
|
||||||
|
letter-spacing: 1rem;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content_title h2 {
|
||||||
|
margin-top: 10px;
|
||||||
|
color: black;
|
||||||
|
font-size: 2rem;
|
||||||
|
letter-spacing: 0.4rem;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width:800px) {
|
||||||
|
.content_title h2 {
|
||||||
|
font-size: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content_title h1 {
|
||||||
|
font-size: 2.5rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
width: 60%;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding-top: 100px;
|
||||||
|
min-height: 100vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width:1200px) {
|
||||||
|
.content {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width:900px) {
|
||||||
|
.content {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content img {
|
||||||
|
height: auto;
|
||||||
|
max-width: 500px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width:600px) {
|
||||||
|
.content img {
|
||||||
|
height: auto;
|
||||||
|
max-width: 320px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width:420px) {
|
||||||
|
.content img {
|
||||||
|
height: auto;
|
||||||
|
max-width: 220px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.warning {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content h1 {
|
||||||
|
font-size: 1.5rem;
|
||||||
|
margin-top: 15px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content h2 {
|
||||||
|
font-size: 1.2rem;
|
||||||
|
margin-top: 15px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
margin-left: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content h3 {
|
||||||
|
font-size: 1.1rem;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
margin-top: 10px;
|
||||||
|
margin-left: 35px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content h4 {
|
||||||
|
font-size: 1rem;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
margin-top: 10px;
|
||||||
|
margin-left: 43px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content p {
|
||||||
|
font-size: 1.0rem;
|
||||||
|
margin-top: 15px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
margin-left: 50px;
|
||||||
|
margin-right: 50px;
|
||||||
|
text-align: justify;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content ul,
|
||||||
|
.content ol {
|
||||||
|
margin-top: 15px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
margin-left: 50px;
|
||||||
|
margin-right: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content li {
|
||||||
|
font-size: 1.0rem;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
margin-top: 5px;
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content li p {
|
||||||
|
margin-left: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content ul li ul li {
|
||||||
|
margin-left: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content img {
|
||||||
|
margin-left: 30px;
|
||||||
|
margin-top: 20px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content table {
|
||||||
|
margin-top: 15px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
border-collapse: collapse;
|
||||||
|
width: 80%;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content table td {
|
||||||
|
border: 1px solid #000;
|
||||||
|
padding: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content table tr:nth-child(even) {
|
||||||
|
background-color: #d1d1d1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content table th {
|
||||||
|
padding-top: 12px;
|
||||||
|
padding-bottom: 12px;
|
||||||
|
text-align: center;
|
||||||
|
background-color: #6b6b6b;
|
||||||
|
color: white;
|
||||||
|
border: 1px solid #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content table caption {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content pre {
|
||||||
|
margin-top: 15px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
margin-left: 35px;
|
||||||
|
margin-right: 35px;
|
||||||
|
padding: 5px;
|
||||||
|
border: 1px solid rgb(173, 173, 173);
|
||||||
|
}
|
||||||
|
|
||||||
|
.content pre code {
|
||||||
|
font-family: "input";
|
||||||
|
font-size: 0.9rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content hr {
|
||||||
|
width: 30%;
|
||||||
|
margin: 20px auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ok:hover {
|
||||||
|
color: rgb(0, 255, 0);
|
||||||
|
}
|
||||||
3
C1/codes/q11_3.py
Normal file
3
C1/codes/q11_3.py
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
while (a < 20) or (b > 50):
|
||||||
|
......
|
||||||
|
......
|
||||||
3
C1/codes/q12_4.py
Normal file
3
C1/codes/q12_4.py
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
x = 1
|
||||||
|
for i in range(10):
|
||||||
|
x = x * 2
|
||||||
4
C1/codes/q3_1.py
Normal file
4
C1/codes/q3_1.py
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
a = 2
|
||||||
|
b = 3
|
||||||
|
c = a ** b
|
||||||
|
d = c % b
|
||||||
6
C1/codes/q5_2.py
Normal file
6
C1/codes/q5_2.py
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
if a==b:
|
||||||
|
c = True
|
||||||
|
elif a > b+10:
|
||||||
|
c = True
|
||||||
|
else:
|
||||||
|
c = False
|
||||||
4
C1/vs/q10_12.py
Normal file
4
C1/vs/q10_12.py
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
if x < 4:
|
||||||
|
x = x + 3
|
||||||
|
else:
|
||||||
|
x = x - 3
|
||||||
3
C1/vs/q11_13.py
Normal file
3
C1/vs/q11_13.py
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
n = 1
|
||||||
|
while n != 20:
|
||||||
|
n = n + 2
|
||||||
3
C1/vs/q11_3.py
Normal file
3
C1/vs/q11_3.py
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
while (a < 20) or (b > 50):
|
||||||
|
......
|
||||||
|
......
|
||||||
3
C1/vs/q12_14.py
Normal file
3
C1/vs/q12_14.py
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
floor(x)
|
||||||
|
Return the floor of x as an Integral. This is the largest in
|
||||||
|
teger <= x.
|
||||||
3
C1/vs/q12_4.py
Normal file
3
C1/vs/q12_4.py
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
x = 1
|
||||||
|
for i in range(10):
|
||||||
|
x = x * 2
|
||||||
5
C1/vs/q13_15.py
Normal file
5
C1/vs/q13_15.py
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
def comparaison(a,b):
|
||||||
|
if a < b:
|
||||||
|
return a
|
||||||
|
else:
|
||||||
|
return b
|
||||||
4
C1/vs/q15_16.py
Normal file
4
C1/vs/q15_16.py
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
m = L[0]
|
||||||
|
for j in range(len(L)):
|
||||||
|
if m < L[j]:
|
||||||
|
m = L[j]
|
||||||
7
C1/vs/q16_17.py
Normal file
7
C1/vs/q16_17.py
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
a = 4
|
||||||
|
b = 4
|
||||||
|
c = 4
|
||||||
|
while a < 5:
|
||||||
|
a = a - 1
|
||||||
|
b = b + 1
|
||||||
|
c = c * b
|
||||||
6
C1/vs/q18_22.py
Normal file
6
C1/vs/q18_22.py
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
def moyenne(notes):
|
||||||
|
somme = 0
|
||||||
|
for cpt in range(len(notes)):
|
||||||
|
....
|
||||||
|
m = somme/len(notes)
|
||||||
|
return m
|
||||||
5
C1/vs/q19_23.py
Normal file
5
C1/vs/q19_23.py
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
def factorielle(n):
|
||||||
|
f = 1
|
||||||
|
.........
|
||||||
|
f = f * i
|
||||||
|
return f
|
||||||
5
C1/vs/q1_5.py
Normal file
5
C1/vs/q1_5.py
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
def ajoute(n,p):
|
||||||
|
somme = 0
|
||||||
|
for i in range(.........): # ligne à modifier
|
||||||
|
somme = somme + i
|
||||||
|
return somme
|
||||||
8
C1/vs/q20_24.py
Normal file
8
C1/vs/q20_24.py
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
def f(t):
|
||||||
|
n = len(t)
|
||||||
|
for i in range(n-1):
|
||||||
|
if t[i] > t[i+1]:
|
||||||
|
t[i],t[i+1] = t[i+1],t[i]
|
||||||
|
|
||||||
|
L = [4, 8, -7, 0, 1]
|
||||||
|
f(L)
|
||||||
4
C1/vs/q21_25.py
Normal file
4
C1/vs/q21_25.py
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
from math import sqrt
|
||||||
|
|
||||||
|
def racine_du_double(x):
|
||||||
|
return sqrt(2*x)
|
||||||
9
C1/vs/q22_26.py
Normal file
9
C1/vs/q22_26.py
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
def essai():
|
||||||
|
a = 2
|
||||||
|
b = 3
|
||||||
|
c = 4
|
||||||
|
return a
|
||||||
|
return b
|
||||||
|
return c
|
||||||
|
|
||||||
|
t = essai()
|
||||||
1
C1/vs/q23_27.py
Normal file
1
C1/vs/q23_27.py
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
resultat = [0] * 7
|
||||||
5
C1/vs/q24_28.py
Normal file
5
C1/vs/q24_28.py
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
def somme(T, a, b):
|
||||||
|
S = 0
|
||||||
|
for i in range(a, b+1) :
|
||||||
|
S = S + T[i]
|
||||||
|
return S
|
||||||
6
C1/vs/q25_29.py
Normal file
6
C1/vs/q25_29.py
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
def maximum(L):
|
||||||
|
m = L[0]
|
||||||
|
for i in range(1,len(L)):
|
||||||
|
if .........:
|
||||||
|
m = L[i]
|
||||||
|
return m
|
||||||
1
C1/vs/q26_30.py
Normal file
1
C1/vs/q26_30.py
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
import os
|
||||||
5
C1/vs/q27_31.py
Normal file
5
C1/vs/q27_31.py
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
def f(x,y,z):
|
||||||
|
if x+y == z:
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
10
C1/vs/q28_32.py
Normal file
10
C1/vs/q28_32.py
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
def maFonction(c):
|
||||||
|
if c <= 10:
|
||||||
|
p = 12
|
||||||
|
if c <= 18:
|
||||||
|
p = 15
|
||||||
|
if c <= 40:
|
||||||
|
p = 19
|
||||||
|
else:
|
||||||
|
p = 20
|
||||||
|
return p
|
||||||
6
C1/vs/q29_33.py
Normal file
6
C1/vs/q29_33.py
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
def f(n):
|
||||||
|
c = 0
|
||||||
|
while n > 0:
|
||||||
|
c = c + 1
|
||||||
|
n = n // 2
|
||||||
|
return c
|
||||||
5
C1/vs/q30_34.py
Normal file
5
C1/vs/q30_34.py
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
def puissance (x,y):
|
||||||
|
p = x
|
||||||
|
for i in range (y - 1):
|
||||||
|
p = p * x
|
||||||
|
return p
|
||||||
3
C1/vs/q31_35.py
Normal file
3
C1/vs/q31_35.py
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
tableau1 = [1, 2, 3]
|
||||||
|
tableau2 = [4, 5, 6]
|
||||||
|
long = len(tableau1 + tableau2)
|
||||||
3
C1/vs/q32_36.py
Normal file
3
C1/vs/q32_36.py
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
a = a - b
|
||||||
|
b = a + b
|
||||||
|
a = ......
|
||||||
7
C1/vs/q33_37.py
Normal file
7
C1/vs/q33_37.py
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
def f(t):
|
||||||
|
n = len(t)
|
||||||
|
for i in range(n-1):
|
||||||
|
for j in range(i+1,n):
|
||||||
|
if t[i] == t[j]:
|
||||||
|
return True
|
||||||
|
return False
|
||||||
6
C1/vs/q34_38.py
Normal file
6
C1/vs/q34_38.py
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
def maximum(tableau):
|
||||||
|
tmp = tableau[0]
|
||||||
|
for i in range(......): # à compléter
|
||||||
|
if tableau[i] > tmp:
|
||||||
|
tmp = tableau[i]
|
||||||
|
return tmp
|
||||||
6
C1/vs/q35_39.py
Normal file
6
C1/vs/q35_39.py
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
a = 3
|
||||||
|
b = 6
|
||||||
|
if a > 5 or b != 3:
|
||||||
|
b = 4
|
||||||
|
else:
|
||||||
|
b = 2
|
||||||
6
C1/vs/q36_40.py
Normal file
6
C1/vs/q36_40.py
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
a = 2
|
||||||
|
b = 5
|
||||||
|
if a > 8:
|
||||||
|
b = 10
|
||||||
|
elif a > 6:
|
||||||
|
b = 3
|
||||||
3
C1/vs/q38_41.py
Normal file
3
C1/vs/q38_41.py
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
i = 0
|
||||||
|
while 2**i < A :
|
||||||
|
i = i + 1
|
||||||
6
C1/vs/q39_42.py
Normal file
6
C1/vs/q39_42.py
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
i = 0
|
||||||
|
while (i < 10) {
|
||||||
|
alert(i)
|
||||||
|
i = i + 1
|
||||||
|
}
|
||||||
|
alert("Fin")
|
||||||
4
C1/vs/q3_1.py
Normal file
4
C1/vs/q3_1.py
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
a = 2
|
||||||
|
b = 3
|
||||||
|
c = a ** b
|
||||||
|
d = c % b
|
||||||
5
C1/vs/q3_6.py
Normal file
5
C1/vs/q3_6.py
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
n = 6
|
||||||
|
s = 0
|
||||||
|
while n >= 0:
|
||||||
|
s = s + n
|
||||||
|
n = n -1
|
||||||
3
C1/vs/q40_43.py
Normal file
3
C1/vs/q40_43.py
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
def maxi(x,y) :
|
||||||
|
m = (x-y+abs(x+y))/2
|
||||||
|
return m
|
||||||
6
C1/vs/q41_44.py
Normal file
6
C1/vs/q41_44.py
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
def fib(n):
|
||||||
|
t = [0] * n
|
||||||
|
t[1] = 1
|
||||||
|
for i in range(2,n):
|
||||||
|
t[i] = t[i-1] + t[i-2]
|
||||||
|
return t
|
||||||
9
C1/vs/q42_45.py
Normal file
9
C1/vs/q42_45.py
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
a = 10
|
||||||
|
if a < 5:
|
||||||
|
a = 20
|
||||||
|
elif a < 100:
|
||||||
|
a = 500
|
||||||
|
elif a < 1000:
|
||||||
|
a = 1
|
||||||
|
else:
|
||||||
|
a = 0
|
||||||
5
C1/vs/q43_46.py
Normal file
5
C1/vs/q43_46.py
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
def puiss(y,x):
|
||||||
|
res = y
|
||||||
|
for i in range(x):
|
||||||
|
res = res*y
|
||||||
|
return res
|
||||||
3
C1/vs/q45_47.py
Normal file
3
C1/vs/q45_47.py
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
n = 1
|
||||||
|
for i in range(4):
|
||||||
|
n = n + 2
|
||||||
5
C1/vs/q46_48.py
Normal file
5
C1/vs/q46_48.py
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
def rey(n):
|
||||||
|
i = 0
|
||||||
|
while i <= n:
|
||||||
|
i = 2*i
|
||||||
|
return i
|
||||||
3
C1/vs/q47_49.py
Normal file
3
C1/vs/q47_49.py
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
L = []
|
||||||
|
for i in range(1,11,2)
|
||||||
|
L.append(5*i)
|
||||||
5
C1/vs/q47_50.py
Normal file
5
C1/vs/q47_50.py
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
L = []
|
||||||
|
# ligne 1 .......
|
||||||
|
while i < 11:
|
||||||
|
L.append(5*i)
|
||||||
|
# ligne 2 .......
|
||||||
5
C1/vs/q48_51.py
Normal file
5
C1/vs/q48_51.py
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
def cube(a):
|
||||||
|
a = a*a*a
|
||||||
|
return a
|
||||||
|
a = 2
|
||||||
|
b = cube(a)
|
||||||
7
C1/vs/q49_52.py
Normal file
7
C1/vs/q49_52.py
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
def cube(L):
|
||||||
|
for i in range(len(L)):
|
||||||
|
L[i] = L[i] * L[i] * L[i]
|
||||||
|
return L
|
||||||
|
|
||||||
|
L = [2, 5]
|
||||||
|
b = cube(L)
|
||||||
7
C1/vs/q50_53.py
Normal file
7
C1/vs/q50_53.py
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
def capital_double (capital, interet):
|
||||||
|
montant = capital
|
||||||
|
n = 0
|
||||||
|
while montant <= 2 * capital:
|
||||||
|
montant = montant + interet
|
||||||
|
n = n + 1
|
||||||
|
return n
|
||||||
7
C1/vs/q51_54.py
Normal file
7
C1/vs/q51_54.py
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
def f(x):
|
||||||
|
y = 2*x + 1
|
||||||
|
return y
|
||||||
|
|
||||||
|
def calcul(x):
|
||||||
|
y = x - 1
|
||||||
|
return f(y)
|
||||||
6
C1/vs/q52_55.py
Normal file
6
C1/vs/q52_55.py
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
x = 4
|
||||||
|
while x > 0:
|
||||||
|
y = 1
|
||||||
|
while y < x:
|
||||||
|
y = y + 1
|
||||||
|
x = x - 1
|
||||||
10
C1/vs/q54_56.py
Normal file
10
C1/vs/q54_56.py
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
def calculPourcentage (prix,reduction):
|
||||||
|
assert reduction >= 0, 'la réduction doit être un nombre p
|
||||||
|
ositif'
|
||||||
|
assert reduction < 100, 'la réduction doit être inférieure
|
||||||
|
à 100'
|
||||||
|
assert prix > 0, 'le prix doit être un nombre strictement
|
||||||
|
positif'
|
||||||
|
remise = (reduction*prix)/100
|
||||||
|
prix_remise = prix - remise
|
||||||
|
return prix_remise
|
||||||
6
C1/vs/q55_57.py
Normal file
6
C1/vs/q55_57.py
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
def minimum(L):
|
||||||
|
mini = 0
|
||||||
|
for e in L:
|
||||||
|
if e < mini:
|
||||||
|
mini = e
|
||||||
|
return mini
|
||||||
5
C1/vs/q56_58.py
Normal file
5
C1/vs/q56_58.py
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
def somme(L):
|
||||||
|
s = L[0]
|
||||||
|
for i in range(len(L)):
|
||||||
|
s = s + L[i]
|
||||||
|
return s
|
||||||
6
C1/vs/q57_59.py
Normal file
6
C1/vs/q57_59.py
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
def f(L,m):
|
||||||
|
R = []
|
||||||
|
for i in range(len(L)):
|
||||||
|
if L[i] > m:
|
||||||
|
R.append(L[i])
|
||||||
|
return R
|
||||||
4
C1/vs/q58_60.py
Normal file
4
C1/vs/q58_60.py
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
a = 11
|
||||||
|
for i in range(3):
|
||||||
|
a = a * 2
|
||||||
|
a = a - 10
|
||||||
3
C1/vs/q59_61.py
Normal file
3
C1/vs/q59_61.py
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
a,b = 10,3
|
||||||
|
if a < 10:
|
||||||
|
a,b = a+2,b+a
|
||||||
6
C1/vs/q5_2.py
Normal file
6
C1/vs/q5_2.py
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
if a==b:
|
||||||
|
c = True
|
||||||
|
elif a > b+10:
|
||||||
|
c = True
|
||||||
|
else:
|
||||||
|
c = False
|
||||||
4
C1/vs/q5_7.py
Normal file
4
C1/vs/q5_7.py
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
def f(a,b):
|
||||||
|
assert b!=0,'le deuxième argument est nul'
|
||||||
|
result = a/b
|
||||||
|
return result
|
||||||
6
C1/vs/q61_62.py
Normal file
6
C1/vs/q61_62.py
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
def maximum(L):
|
||||||
|
m = L[0]
|
||||||
|
for i in range(1,len(L)):
|
||||||
|
..............
|
||||||
|
..............
|
||||||
|
return m
|
||||||
7
C1/vs/q62_67.py
Normal file
7
C1/vs/q62_67.py
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
def maxi(L):
|
||||||
|
dernier_indice = len(L) - 1
|
||||||
|
valeur_max = L[0]
|
||||||
|
for i in range(1,dernier_indice):
|
||||||
|
if L[i] > valeur_max:
|
||||||
|
valeur_max = liste[i]
|
||||||
|
return valeur_max
|
||||||
4
C1/vs/q63_68.py
Normal file
4
C1/vs/q63_68.py
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
import math
|
||||||
|
|
||||||
|
def aireDisque(R):
|
||||||
|
return math.pi * R**2
|
||||||
7
C1/vs/q64_73.py
Normal file
7
C1/vs/q64_73.py
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
def f(a,m):
|
||||||
|
i = 1
|
||||||
|
n = 0
|
||||||
|
while n <= m:
|
||||||
|
i = i * a
|
||||||
|
n = n + 1
|
||||||
|
return i
|
||||||
5
C1/vs/q6_8.py
Normal file
5
C1/vs/q6_8.py
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
def f(x,y):
|
||||||
|
x = x + y
|
||||||
|
y = x - y
|
||||||
|
x = x - y
|
||||||
|
return (x,y)
|
||||||
6
C1/vs/q7_9.py
Normal file
6
C1/vs/q7_9.py
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
def mystere(T):
|
||||||
|
s = 0
|
||||||
|
for k in T:
|
||||||
|
if k % 2 == 0:
|
||||||
|
s = s+k
|
||||||
|
return s
|
||||||
8
C1/vs/q8_10.py
Normal file
8
C1/vs/q8_10.py
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
def calcul(a,b):
|
||||||
|
a = a + 2
|
||||||
|
b = b + 5
|
||||||
|
c = a + b
|
||||||
|
return c
|
||||||
|
|
||||||
|
a,b = 3,5
|
||||||
|
calcul(a,b)
|
||||||
6
C1/vs/q9_11.py
Normal file
6
C1/vs/q9_11.py
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
def ranger(a, b, c):
|
||||||
|
if a > b :
|
||||||
|
a, b = b, a
|
||||||
|
if b > c:
|
||||||
|
b, c = c, b
|
||||||
|
return a, b, c
|
||||||
7
C1/vs/r17_a.py
Normal file
7
C1/vs/r17_a.py
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
def factorielle(n):
|
||||||
|
i = 0
|
||||||
|
fact = 1
|
||||||
|
while i <= n:
|
||||||
|
fact = fact * i
|
||||||
|
i = i + 1
|
||||||
|
return fact
|
||||||
7
C1/vs/r17_b.py
Normal file
7
C1/vs/r17_b.py
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
def factorielle(n):
|
||||||
|
i = 1
|
||||||
|
fact = 1
|
||||||
|
while i < n:
|
||||||
|
fact = fact * i
|
||||||
|
i = i + 1
|
||||||
|
return fact
|
||||||
7
C1/vs/r17_c.py
Normal file
7
C1/vs/r17_c.py
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
def factorielle(n):
|
||||||
|
i = 0
|
||||||
|
fact = 1
|
||||||
|
while i < n:
|
||||||
|
i = i + 1
|
||||||
|
fact = fact * i
|
||||||
|
return fact
|
||||||
7
C1/vs/r17_d.py
Normal file
7
C1/vs/r17_d.py
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
def factorielle(n):
|
||||||
|
i = 0
|
||||||
|
fact = 1
|
||||||
|
while i <= n:
|
||||||
|
i = i + 1
|
||||||
|
fact = fact * i
|
||||||
|
return fact
|
||||||
2
C1/vs/r61_a.py
Normal file
2
C1/vs/r61_a.py
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
if m < L[i]:
|
||||||
|
L[i] = m
|
||||||
2
C1/vs/r61_b.py
Normal file
2
C1/vs/r61_b.py
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
if L[i-1] < L[i]:
|
||||||
|
m = L[i]
|
||||||
2
C1/vs/r61_c.py
Normal file
2
C1/vs/r61_c.py
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
if L[i] < L[0]:
|
||||||
|
L[i],L[0] = L[0],L[i]
|
||||||
2
C1/vs/r61_d.py
Normal file
2
C1/vs/r61_d.py
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
if L[i] > m:
|
||||||
|
m = L[i]
|
||||||
2
C1/vs/r63_a.py
Normal file
2
C1/vs/r63_a.py
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
import GeomPlan
|
||||||
|
GeomPlan.aireDisque(8)
|
||||||
2
C1/vs/r63_b.py
Normal file
2
C1/vs/r63_b.py
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
import GeomPlan
|
||||||
|
aireDisque(8)
|
||||||
2
C1/vs/r63_c.py
Normal file
2
C1/vs/r63_c.py
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
from GeomPlan import *
|
||||||
|
aireDisque(8)
|
||||||
2
C1/vs/r63_d.py
Normal file
2
C1/vs/r63_d.py
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
from GeomPlan import aireDisque
|
||||||
|
aireDisque(8)
|
||||||
2976
C2/c2.html
Normal file
2976
C2/c2.html
Normal file
File diff suppressed because it is too large
Load diff
BIN
C2/c2_fichiers/bns_4.jpg
Normal file
BIN
C2/c2_fichiers/bns_4.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.6 KiB |
99
C2/c2_fichiers/github.css
Normal file
99
C2/c2_fichiers/github.css
Normal file
|
|
@ -0,0 +1,99 @@
|
||||||
|
/*
|
||||||
|
|
||||||
|
github.com style (c) Vasily Polovnyov <vast@whiteants.net>
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
.hljs {
|
||||||
|
display: block;
|
||||||
|
overflow-x: auto;
|
||||||
|
padding: 0.5em;
|
||||||
|
color: #333;
|
||||||
|
background: #f8f8f8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-comment,
|
||||||
|
.hljs-quote {
|
||||||
|
color: #998;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-keyword,
|
||||||
|
.hljs-selector-tag,
|
||||||
|
.hljs-subst {
|
||||||
|
color: #333;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-number,
|
||||||
|
.hljs-literal,
|
||||||
|
.hljs-variable,
|
||||||
|
.hljs-template-variable,
|
||||||
|
.hljs-tag .hljs-attr {
|
||||||
|
color: #008080;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-string,
|
||||||
|
.hljs-doctag {
|
||||||
|
color: #d14;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-title,
|
||||||
|
.hljs-section,
|
||||||
|
.hljs-selector-id {
|
||||||
|
color: #900;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-subst {
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-type,
|
||||||
|
.hljs-class .hljs-title {
|
||||||
|
color: #458;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-tag,
|
||||||
|
.hljs-name,
|
||||||
|
.hljs-attribute {
|
||||||
|
color: #000080;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-regexp,
|
||||||
|
.hljs-link {
|
||||||
|
color: #009926;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-symbol,
|
||||||
|
.hljs-bullet {
|
||||||
|
color: #990073;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-built_in,
|
||||||
|
.hljs-builtin-name {
|
||||||
|
color: #0086b3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-meta {
|
||||||
|
color: #999;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-deletion {
|
||||||
|
background: #fdd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-addition {
|
||||||
|
background: #dfd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-emphasis {
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-strong {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
667
C2/c2_fichiers/highlight.pack.js
Normal file
667
C2/c2_fichiers/highlight.pack.js
Normal file
File diff suppressed because one or more lines are too long
1
C2/c2_fichiers/menu.svg
Normal file
1
C2/c2_fichiers/menu.svg
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#FFFFFF"><path d="M0 0h24v24H0z" fill="none"/><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/></svg>
|
||||||
|
After Width: | Height: | Size: 202 B |
30
C2/c2_fichiers/script.js
Normal file
30
C2/c2_fichiers/script.js
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
const menu = document.querySelector("header nav img")
|
||||||
|
const aside = document.querySelector("aside")
|
||||||
|
const content = document.querySelector(".content")
|
||||||
|
|
||||||
|
let toggle = false;
|
||||||
|
|
||||||
|
menu.addEventListener('click', () => {
|
||||||
|
toggle = !toggle
|
||||||
|
console.log('clic')
|
||||||
|
if (toggle) {
|
||||||
|
aside.classList.add('show_aside')
|
||||||
|
aside.classList.remove('hidden_aside')
|
||||||
|
} else {
|
||||||
|
aside.classList.add('hidden_aside')
|
||||||
|
aside.classList.remove('show_aside')
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
if (content != null) {
|
||||||
|
content.addEventListener('click', () => {
|
||||||
|
if (toggle) {
|
||||||
|
toggle = false
|
||||||
|
aside.classList.add('hidden_aside')
|
||||||
|
aside.classList.remove('show_aside')
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
338
C2/c2_fichiers/style.css
Normal file
338
C2/c2_fichiers/style.css
Normal file
|
|
@ -0,0 +1,338 @@
|
||||||
|
@font-face {
|
||||||
|
font-family: "input";
|
||||||
|
src: url("fonts/InputMonoNarrow-Light.ttf");
|
||||||
|
}
|
||||||
|
|
||||||
|
* {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
font-family: Helvetica, Georgia, sans-serif;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
background-color: rgb(255, 255, 255);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************header+aside****************************************/
|
||||||
|
header {
|
||||||
|
background-color: #424242;
|
||||||
|
position: fixed;
|
||||||
|
width: 100%;
|
||||||
|
height: 60px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
color: white;
|
||||||
|
z-index: 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
header nav {
|
||||||
|
margin-left: 40px;
|
||||||
|
width: 10%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
list-style: none;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width:800px) {
|
||||||
|
header h2 {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
header h3 {
|
||||||
|
font-size: 1rem;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
header nav {
|
||||||
|
width: 50%
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
header nav img {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
header h2 {
|
||||||
|
margin-right: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width:800px) {
|
||||||
|
.content {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
aside {
|
||||||
|
position: fixed;
|
||||||
|
top: 60px;
|
||||||
|
left: -300px;
|
||||||
|
width: 300px;
|
||||||
|
background-color: rgba(7, 7, 7, 0.8);
|
||||||
|
list-style: none;
|
||||||
|
height: 100vh;
|
||||||
|
overflow-y: scroll;
|
||||||
|
list-style: none;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
aside>ul {
|
||||||
|
padding-top: 30px;
|
||||||
|
padding-bottom: 70px;
|
||||||
|
padding-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
aside ul {
|
||||||
|
list-style: none;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
aside ul li ul {
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
aside a {
|
||||||
|
display: inline-block;
|
||||||
|
color: rgb(200, 200, 200);
|
||||||
|
margin: 5px;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
aside::-webkit-scrollbar {
|
||||||
|
background: #000;
|
||||||
|
width: 10px;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
aside:hover::-webkit-scrollbar {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
aside::-webkit-scrollbar-thumb {
|
||||||
|
background-color: #838383;
|
||||||
|
}
|
||||||
|
|
||||||
|
aside::-webkit-scrollbar-thumb:hover {
|
||||||
|
background-color: #bbbbbb;
|
||||||
|
}
|
||||||
|
|
||||||
|
aside ul li a:hover {
|
||||||
|
color: rgb(110, 110, 110);
|
||||||
|
}
|
||||||
|
|
||||||
|
.show_aside {
|
||||||
|
transform: translateX(300px);
|
||||||
|
transition-property: transform;
|
||||||
|
transition-duration: 1s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hidden_aside {
|
||||||
|
transform: translateX(0px);
|
||||||
|
transition-property: transform;
|
||||||
|
transition-duration: 1s;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*********************fin header+aside***********************************/
|
||||||
|
|
||||||
|
/***********************content**************************************/
|
||||||
|
.content_title {
|
||||||
|
min-height: 100vh;
|
||||||
|
width: 100%;
|
||||||
|
margin: 0 auto;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content_title h1 {
|
||||||
|
|
||||||
|
color: black;
|
||||||
|
text-transform: uppercase;
|
||||||
|
font-size: 5rem;
|
||||||
|
letter-spacing: 1rem;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content_title h2 {
|
||||||
|
margin-top: 10px;
|
||||||
|
color: black;
|
||||||
|
font-size: 2rem;
|
||||||
|
letter-spacing: 0.4rem;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width:800px) {
|
||||||
|
.content_title h2 {
|
||||||
|
font-size: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content_title h1 {
|
||||||
|
font-size: 2.5rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
width: 60%;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding-top: 100px;
|
||||||
|
min-height: 100vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width:1200px) {
|
||||||
|
.content {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width:900px) {
|
||||||
|
.content {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content img {
|
||||||
|
height: auto;
|
||||||
|
max-width: 500px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width:600px) {
|
||||||
|
.content img {
|
||||||
|
height: auto;
|
||||||
|
max-width: 320px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width:420px) {
|
||||||
|
.content img {
|
||||||
|
height: auto;
|
||||||
|
max-width: 220px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.warning {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content h1 {
|
||||||
|
font-size: 1.5rem;
|
||||||
|
margin-top: 15px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content h2 {
|
||||||
|
font-size: 1.2rem;
|
||||||
|
margin-top: 15px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
margin-left: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content h3 {
|
||||||
|
font-size: 1.1rem;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
margin-top: 10px;
|
||||||
|
margin-left: 35px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content h4 {
|
||||||
|
font-size: 1rem;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
margin-top: 10px;
|
||||||
|
margin-left: 43px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content p {
|
||||||
|
font-size: 1.0rem;
|
||||||
|
margin-top: 15px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
margin-left: 50px;
|
||||||
|
margin-right: 50px;
|
||||||
|
text-align: justify;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content ul,
|
||||||
|
.content ol {
|
||||||
|
margin-top: 15px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
margin-left: 50px;
|
||||||
|
margin-right: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content li {
|
||||||
|
font-size: 1.0rem;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
margin-top: 5px;
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content li p {
|
||||||
|
margin-left: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content ul li ul li {
|
||||||
|
margin-left: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content img {
|
||||||
|
margin-left: 30px;
|
||||||
|
margin-top: 20px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content table {
|
||||||
|
margin-top: 15px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
border-collapse: collapse;
|
||||||
|
width: 80%;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content table td {
|
||||||
|
border: 1px solid #000;
|
||||||
|
padding: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content table tr:nth-child(even) {
|
||||||
|
background-color: #d1d1d1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content table th {
|
||||||
|
padding-top: 12px;
|
||||||
|
padding-bottom: 12px;
|
||||||
|
text-align: center;
|
||||||
|
background-color: #6b6b6b;
|
||||||
|
color: white;
|
||||||
|
border: 1px solid #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content table caption {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content pre {
|
||||||
|
margin-top: 15px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
margin-left: 35px;
|
||||||
|
margin-right: 35px;
|
||||||
|
padding: 5px;
|
||||||
|
border: 1px solid rgb(173, 173, 173);
|
||||||
|
}
|
||||||
|
|
||||||
|
.content pre code {
|
||||||
|
font-family: "input";
|
||||||
|
font-size: 0.9rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content hr {
|
||||||
|
width: 30%;
|
||||||
|
margin: 20px auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ok:hover {
|
||||||
|
color: rgb(0, 255, 0);
|
||||||
|
}
|
||||||
9
C2/codes/q100_86.py
Normal file
9
C2/codes/q100_86.py
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
def maxi(t):
|
||||||
|
m = t[0]
|
||||||
|
for x in t:
|
||||||
|
if x[1] >= m[1]:
|
||||||
|
m = x
|
||||||
|
return m
|
||||||
|
|
||||||
|
L = [('Alice', 17), ('Barnabé', 17),('Casimir', 17),
|
||||||
|
('Doriane', 17),('Emilien', 14), ('Fabienne', 16)]
|
||||||
3
C2/codes/q101_87.py
Normal file
3
C2/codes/q101_87.py
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
course = [(5,['Mistral','Lille']),
|
||||||
|
(3,['Zéphir','Paris']),(7,['Ouragan','Bordeaux']),
|
||||||
|
......, ....... ]
|
||||||
9
C2/codes/q102_88.py
Normal file
9
C2/codes/q102_88.py
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
t1 = [['Valenciennes', 24],['Lille', 23],['Laon',
|
||||||
|
31],['Arras', 18]]
|
||||||
|
t2 = [['Lille', 62],['Arras', 53],['Valenciennes',
|
||||||
|
67],['Laon', 48]]
|
||||||
|
|
||||||
|
for i in range(len(t1)):
|
||||||
|
for v in t2:
|
||||||
|
if v[0] == t1[i][0]:
|
||||||
|
t1[i].append(v[1])
|
||||||
6
C2/codes/q103_89.py
Normal file
6
C2/codes/q103_89.py
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
def extreme(t, test):
|
||||||
|
m = t[0]
|
||||||
|
for x in t:
|
||||||
|
if test(x,m):
|
||||||
|
m = x
|
||||||
|
return m
|
||||||
2
C2/codes/q103_90.py
Normal file
2
C2/codes/q103_90.py
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
L = [('Alice', 17), ('Barnabé', 18),('Casimir', 17),
|
||||||
|
('Doriane', 20),('Emilien', 15), ('Fabienne', 16)]
|
||||||
2
C2/codes/q104_95.py
Normal file
2
C2/codes/q104_95.py
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
clients = [("Dupont", "Paul", 1),("Durand", "Jacques",
|
||||||
|
2),("Dutronc", "Jean", 3),...]
|
||||||
4
C2/codes/q104_96.py
Normal file
4
C2/codes/q104_96.py
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
x = []
|
||||||
|
for i in range(len(clients)):
|
||||||
|
if clients[i][1] == "Jean":
|
||||||
|
x = clients[i]
|
||||||
6
C2/codes/q105_97.py
Normal file
6
C2/codes/q105_97.py
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
t = [[3,4,5,1],[33,6,1,2]]
|
||||||
|
x = t[0][0]
|
||||||
|
for i in range(len(t)):
|
||||||
|
for j in range(len(t[i])):
|
||||||
|
if x < t[i][j]:
|
||||||
|
x = t[i][j]
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue