Compare commits

...

2 commits

Author SHA1 Message Date
5e47d1853c remove C1/vs files 2025-08-26 18:39:32 +02:00
eb3c7313c5 QCM C1 2025-08-26 18:38:28 +02:00
126 changed files with 10468 additions and 0 deletions

BIN
C1/C1.pdf Normal file

Binary file not shown.

342
C1/c1.html Normal file
View 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 lexpression 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 &lt; 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 &gt; 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 &gt; b+10)</span>
</p>
<p>
B- c = (a==b) and (a &gt; b+10)
</p>
<p>
C- c = not(a==b)
</p>
<p>
D- c = not(a &gt; 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&nbsp;?
</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. Lexpression 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 &lt; <span class="hljs-number">20</span>) <span class="hljs-keyword">or</span> (b &gt; <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 &lt; 20 ou b &gt;50
</p>
<p>
B- la boucle prend fin lorsque a &lt; 20 et b &gt; 50
</p>
<p>
C- la boucle prend fin lorsque a &gt;= 20 ou b &lt;= 50 </p>
<p>
<span class="ok">D- la boucle prend fin lorsque a &gt;= 20 et b &lt;= 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
View 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 lexpression 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. Lexpression 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
View 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;
}

File diff suppressed because one or more lines are too long

1
C1/c1_fichiers/menu.svg Normal file
View 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
View 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
View 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
View file

@ -0,0 +1,3 @@
while (a < 20) or (b > 50):
......
......

3
C1/codes/q12_4.py Normal file
View file

@ -0,0 +1,3 @@
x = 1
for i in range(10):
x = x * 2

4
C1/codes/q3_1.py Normal file
View file

@ -0,0 +1,4 @@
a = 2
b = 3
c = a ** b
d = c % b

6
C1/codes/q5_2.py Normal file
View file

@ -0,0 +1,6 @@
if a==b:
c = True
elif a > b+10:
c = True
else:
c = False

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

99
C2/c2_fichiers/github.css Normal file
View 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;
}

File diff suppressed because one or more lines are too long

1
C2/c2_fichiers/menu.svg Normal file
View 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
View 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
View 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
View 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
View file

@ -0,0 +1,3 @@
course = [(5,['Mistral','Lille']),
(3,['Zéphir','Paris']),(7,['Ouragan','Bordeaux']),
......, ....... ]

9
C2/codes/q102_88.py Normal file
View 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
View 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
View 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
View file

@ -0,0 +1,2 @@
clients = [("Dupont", "Paul", 1),("Durand", "Jacques",
2),("Dutronc", "Jean", 3),...]

4
C2/codes/q104_96.py Normal file
View 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
View 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]

4
C2/codes/q106_98.py Normal file
View file

@ -0,0 +1,4 @@
table = [12, 43, 6, 22, 37]
for i in range(len(table) - 1):
if table[i] > table[i+1]:
table[i],table[i+1] = table[i+1], table[i]

1
C2/codes/q109_99.py Normal file
View file

@ -0,0 +1 @@
x = [ "x1", "x2", "x3" ]

6
C2/codes/q11_8.py Normal file
View file

@ -0,0 +1,6 @@
# n et p sont initialisés dans les lignes précédentes
t = [ [ 0 for j in range(p) ] for i in range(n) ]
for k in range(n*p):
t[k%n][k%p] = k

5
C2/codes/q13_9.py Normal file
View file

@ -0,0 +1,5 @@
A = [ [1,2,3], [4,5,6], [7,8,9] ]
B = [ [0,0,0], [0,0,0], [0,0,0] ]
for i in range(3):
for j in range(3):
B[i][j] = A[j][i]

3
C2/codes/q14_10.py Normal file
View file

@ -0,0 +1,3 @@
alphabet = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',
'U', 'V', 'W', 'X', 'Y', 'Z' ]

2
C2/codes/q16_11.py Normal file
View file

@ -0,0 +1,2 @@
t = [0, 3, 5, 7, 9]
t[9] = 3 + t[5]

1
C2/codes/q17_12.py Normal file
View file

@ -0,0 +1 @@
resultat = [ i*2 for i in range(10) ]

5
C2/codes/q18_13.py Normal file
View file

@ -0,0 +1,5 @@
def somme(tab):
s = 0
for i in range(len(tab)):
......
return s

6
C2/codes/q19_14.py Normal file
View file

@ -0,0 +1,6 @@
m = []
for i in range(5):
n = []
for j in range(3):
n.append(i*j)
m.append(n)

3
C2/codes/q1_1.py Normal file
View file

@ -0,0 +1,3 @@
n = 5
p = 3
t = [ [ for j in range(p) ] for i in range(n) ]

4
C2/codes/q20_15.py Normal file
View file

@ -0,0 +1,4 @@
def feed(t):
for i in range(len(t)):
t[i] = 0
return t

6
C2/codes/q21_16.py Normal file
View file

@ -0,0 +1,6 @@
def f(L):
m = L[0]
for x in L:
if x > m:
m = x
return m

2
C2/codes/q22_17.py Normal file
View file

@ -0,0 +1,2 @@
t = [1, 6, 8, 3, 21]
u = [x for x in t if x > 3]

2
C2/codes/q23_18.py Normal file
View file

@ -0,0 +1,2 @@
t = [1,2,3,4,5,6,7,8,9]
v = [c for c in t if c%3 == 0]

8
C2/codes/q28_19.py Normal file
View file

@ -0,0 +1,8 @@
def construitTable(L,C):
t = []
for i in range(L):
ligne = []
for j in range(C):
......
t.append(ligne)
return t

4
C2/codes/q29_20.py Normal file
View file

@ -0,0 +1,4 @@
def f(n1,n2):
etendue = max(n1,n2)-min(n1,n2)
moyenne = (n1+n2)/2
return etendue,moyenne

2
C2/codes/q2_2.py Normal file
View file

@ -0,0 +1,2 @@
t = [2, 8, 9, 2]
t[2] = t[2] + 5

5
C2/codes/q33_21.py Normal file
View file

@ -0,0 +1,5 @@
G =[[0, 0, 0, , 0],
[0, 0, 0, , 0],
[0, 0, 0, , 0]
.
[0, 0, 0, , 0]]

2
C2/codes/q35_22.py Normal file
View file

@ -0,0 +1,2 @@
tab = [ ('Léa', 14), ('Guillaume', 12), ('Anthony', 16),
('Anne', 15) ]

1
C2/codes/q37_23.py Normal file
View file

@ -0,0 +1 @@
t = [ [1,2,3,4], [5,6,7,8], [9,10,11,12] ]

9
C2/codes/q3_3.py Normal file
View file

@ -0,0 +1,9 @@
annee2019 = [('janvier',6), ('février',6), ('mars',12),
('avril',20), ('mai',23), ('juin',25),
('juillet',29), ('août',25), ('septembre',22),
('octobre',15), ('novembre',11), ('décembre',7)]
m = annee2019[0][1]
for mois in annee2019:
if (m > mois[1]):
m = mois[1]

2
C2/codes/q42_24.py Normal file
View file

@ -0,0 +1,2 @@
T = [[1,2,3,4,5], [6,7,8,9,10], [11,12,13,14,15],
[16,17,18,19,20]].

1
C2/codes/q44_25.py Normal file
View file

@ -0,0 +1 @@
[[0,0,0,0], [1,1,1,1], [2,2,2,2]]

2
C2/codes/q45_26.py Normal file
View file

@ -0,0 +1,2 @@
notes = [('Toto', 20), ('John', 12), ('Johnny', 2),
('Superman', 16)]

1
C2/codes/q47_27.py Normal file
View file

@ -0,0 +1 @@
M = [ [i*j for j in range(4)] for i in range(4) ]

3
C2/codes/q49_28.py Normal file
View file

@ -0,0 +1,3 @@
tab=[['A', 'B', 'C', 'D'],
['E', 'F', 'G', 'H'],
['I', 'J', 'K', 'L'] ]

3
C2/codes/q49_29.py Normal file
View file

@ -0,0 +1,3 @@
# à la fin, on a l'égalité :
L == [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
'K', 'L' ]

8
C2/codes/q52_34.py Normal file
View file

@ -0,0 +1,8 @@
def divEuclid(n,d):
'''renvoie le couple formé du quotient et du reste dans la
division de n par d'''
q = 0
while n-d > 0:
q = q + 1
n = n - d
.......

1
C2/codes/q52_35.py Normal file
View file

@ -0,0 +1 @@
(quotient,reste) = divEuclid(15,6)

2
C2/codes/q55_36.py Normal file
View file

@ -0,0 +1,2 @@
tableau = [5,8,6,9]
a = tableau[2]

4
C2/codes/q59_37.py Normal file
View file

@ -0,0 +1,4 @@
res = [ [1,2,3], [4,5,6], [7,8,9] ]
S = 0
for i in range(3):
S = S + res[i][2]

2
C2/codes/q5_4.py Normal file
View file

@ -0,0 +1,2 @@
t = (10,6,1,12,15)
r = t[3] - t[1]

3
C2/codes/q60_38.py Normal file
View file

@ -0,0 +1,3 @@
echiquier = [ [ 0 for i in range(8) ] for j in range(8) ]
echiquier[2][0] = 1
echiquier[3][1] = 1

1
C2/codes/q61_43.py Normal file
View file

@ -0,0 +1 @@
L = [6, 2, 8, 24, 3, 6, 7, 8]

3
C2/codes/q61_44.py Normal file
View file

@ -0,0 +1,3 @@
p = 8
M = [x for x in L if x<p] + [x for x in L if x==p] + [x for
x in L if x>p]

5
C2/codes/q62_45.py Normal file
View file

@ -0,0 +1,5 @@
def f(L):
U = []
for i in L:
U.append(i**2 - 1)
return U

1
C2/codes/q64_46.py Normal file
View file

@ -0,0 +1 @@
tableau = [[1,2],[3,4],[5,6]]

1
C2/codes/q66_47.py Normal file
View file

@ -0,0 +1 @@
tableau = [ [i+2*j for j in range(4)] for i in range(4)]

4
C2/codes/q70_52.py Normal file
View file

@ -0,0 +1,4 @@
def f(L):
return [x*x for x in L if x%2 == 1]
carre = f([0,1,2,3,4,5,6,7,8,9])

1
C2/codes/q71_53.py Normal file
View file

@ -0,0 +1 @@
t = [ x for x in range(2,12) if x % 2 == 1 ]

1
C2/codes/q72_54.py Normal file
View file

@ -0,0 +1 @@
L = [['a','b','c'],['bonjour','hello']]

3
C2/codes/q73_55.py Normal file
View file

@ -0,0 +1,3 @@
for i in range(n):
for j in range(n):
......

2
C2/codes/q75_56.py Normal file
View file

@ -0,0 +1,2 @@
L = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
'K', 'L' ]

4
C2/codes/q75_57.py Normal file
View file

@ -0,0 +1,4 @@
# à la fin, on a l'égalité :
tab == [['A', 'B', 'C', 'D'],
['E', 'F', 'G', 'H'],
['I', 'J', 'K', 'L'] ]

4
C2/codes/q76_62.py Normal file
View file

@ -0,0 +1,4 @@
T = [[12,13,14,15],
[24,25,26,27],
[35,36,49,33],
[61,53,55,58]]

2
C2/codes/q79_71.py Normal file
View file

@ -0,0 +1,2 @@
M = [['A','B','C','D'], ['E','F','G','H'],
['I','J','K','L']]

2
C2/codes/q7_5.py Normal file
View file

@ -0,0 +1,2 @@
def f(x):
return (x, x**2)

5
C2/codes/q83_72.py Normal file
View file

@ -0,0 +1,5 @@
def f(L):
S = []
for i in range(len(L)-1):
S.append(L[i] + L[i+1])
return S

8
C2/codes/q84_73.py Normal file
View file

@ -0,0 +1,8 @@
def quoi(liste):
maListe = []
for i in range(len(liste))
maListe.append(liste[i][0])
return maListe
L = [[5,8,12,1], [20,11,3,8], [3,12,1,4], [2,13,17,3]]
m = quoi(L)

3
C2/codes/q86_74.py Normal file
View file

@ -0,0 +1,3 @@
Table = [('Grace','Hopper','F',1906),('Tim', 'Berners-Lee',
'H', 1955),('Ada', 'Lovelace', 'F', 1815), ('Alan',
'Turing', 'H', 1912)]

6
C2/codes/q86_75.py Normal file
View file

@ -0,0 +1,6 @@
def fonctionMystere(table):
mystere = []
for ligne in table:
if ligne[2] == 'F':
mystere.append(ligne[1])
return mystere

2
C2/codes/q88_76.py Normal file
View file

@ -0,0 +1,2 @@
table = [[1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3]]
table [1][2] = 5

2
C2/codes/q89_77.py Normal file
View file

@ -0,0 +1,2 @@
a = [5, 4, 3, 4, 7]
a.append(4)

3
C2/codes/q8_6.py Normal file
View file

@ -0,0 +1,3 @@
tictactoe = [['X', 'O', 'O'],
['O', 'O', 'O'],
['O', 'O', 'X']]

6
C2/codes/q90_78.py Normal file
View file

@ -0,0 +1,6 @@
image = [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0,
0, 0]]
for i in range(4):
for j in range(4):
if (i+j) == 3:
image[i][j] = 1

4
C2/codes/q92_79.py Normal file
View file

@ -0,0 +1,4 @@
mendeleiev = [['H','.', '.','.','.','.','.','He'],
['Li','Be','B','C','N','O','Fl','Ne'],
['Na','Mg','Al','Si','P','S','Cl','Ar'],
...... ]

6
C2/codes/q93_80.py Normal file
View file

@ -0,0 +1,6 @@
asso = []
L =  [ ['marc','marie'], ['marie','jean'],
['paul','marie'], ['marie','marie'], ['marc','anne'] ]
for c in L :
if c[1]==marie:
asso.append(c[0])

3
C2/codes/q94_81.py Normal file
View file

@ -0,0 +1,3 @@
a = [1, 2, 3]
b = [4, 5, 6]
c = a + b

4
C2/codes/q95_82.py Normal file
View file

@ -0,0 +1,4 @@
mendeleiev = [['H','.', '.','.','.','.','.','He'],
['Li','Be','B','C','N','O','Fl','Ne'],
['Na','Mg','Al','Si','P','S','Cl','Ar'],
...... ]

4
C2/codes/q96_83.py Normal file
View file

@ -0,0 +1,4 @@
data1 = [(Bruce, Wayne), (Chuck, Norris), (Bruce,
Lee), (Clark, Kent)]
data2 = [(Diana, Prince), (Chuck, Norris),
(Peter, Parker)]

9
C2/codes/q97_84.py Normal file
View file

@ -0,0 +1,9 @@
def f(T):
s = 0
for k in T:
if k == 8:
s = s+1
if s > 1:
return True
else:
return False

3
C2/codes/q99_85.py Normal file
View file

@ -0,0 +1,3 @@
collection = [('Renault', '4L', 1974, 30),
('Peugeot', '504', 1970, 82),
('Citroën', 'Traction', 1950, 77)]

2
C2/codes/q9_7.py Normal file
View file

@ -0,0 +1,2 @@
M = [['A','B','C','D'], ['E','F','G','H'],
['I','J','K','L']]

2
C2/codes/r103_a.py Normal file
View file

@ -0,0 +1,2 @@
def test(a,b):
return a[0] < b[0]

2
C2/codes/r103_b.py Normal file
View file

@ -0,0 +1,2 @@
def test(a,b):
return a[0] > b[0]

2
C2/codes/r103_c.py Normal file
View file

@ -0,0 +1,2 @@
def test(a,b):
return a[1] < b[1]

2
C2/codes/r103_d.py Normal file
View file

@ -0,0 +1,2 @@
def test(a,b):
return a[1] > b[1]

4
C2/codes/r49_a.py Normal file
View file

@ -0,0 +1,4 @@
L = []
for i in range(3):
for j in range(4):
L.append(tab[i][j])

4
C2/codes/r49_b.py Normal file
View file

@ -0,0 +1,4 @@
L = []
for i in range(4):
for j in range(3):
L.append(tab[i][j])

3
C2/codes/r49_c.py Normal file
View file

@ -0,0 +1,3 @@
L = []
for i in range(3):
L.append(tab[i])

3
C2/codes/r49_d.py Normal file
View file

@ -0,0 +1,3 @@
L = []
for i in range(4):
L.append(tab[i])

5
C2/codes/r60_a.py Normal file
View file

@ -0,0 +1,5 @@
def ok(echiquier,i,j):
for col in range(i):
if echiquier[i][col] == 1:
return False
return True

5
C2/codes/r60_b.py Normal file
View file

@ -0,0 +1,5 @@
def ok(echiquier,i,j):
for lig in range(i):
if echiquier[lig][j] == 1:
return False
return True

Some files were not shown because too many files have changed in this diff Show more