Skip to content
Extraits de code Groupes Projets
Valider f9d71960 rédigé par Romain Casati's avatar Romain Casati
Parcourir les fichiers

sequenced: examples updated

parent a2aa6a31
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
from basthon.notebook import ValidationFunction
from basthon.notebook import ValidationFunctionPretty
class MyValidation(ValidationFunction):
......@@ -14,11 +14,11 @@ class MyValidation(ValidationFunction):
print("✅ Félicitations ! Ton code fonctionne.")
class MyValidationEnd(ValidationFunction):
class MyValidationEnd(ValidationFunctionPretty):
def handle_full_success(self):
print("✅ Félicitations ! Tu as terminé le notebook !")
test_oppose = MyValidation("oppose", [10, -1.1, 2e5], [-10, 1.1, -2e5])
test_carre = MyValidation("carre", [2, -3, 0], [4, 9, 0])
test_absolue = MyValidationEnd("absolue", [2, -3, 0], [2, 3, 0])
test_oppose = ValidationFunctionPretty("oppose", [10, -1.1, 2e5], [-10, 1.1, -2e5])
test_carre = ValidationFunctionPretty("carre", [2, -3, 0], [4, 9, 0])
test_absolue = ValidationFunctionEnd("absolue", [2, -3, 0], [2, 3, 0])
%% Cell type:code id: tags:
``` python
from _validation import *
```
%% Cell type:markdown id: tags:
### Question 1
%% Cell type:markdown id: tags:
Écris la fonction opposé c'est-à-dire $x \mapsto -x$
%% Cell type:code id: tags:
``` python
def oppose(x):
return
```
%% Cell type:code id: tags:
%% Cell type:code id: tags:breakpoint
``` python
### VALIDATION ###
test_oppose()
```
%% Cell type:markdown id: tags:
### Question 2
%% Cell type:markdown id: tags:
Écris la fonction carré
%% Cell type:code id: tags:
``` python
def carre(x):
return
```
%% Cell type:code id: tags:
%% Cell type:code id: tags:breakpoint
``` python
### VALIDATION ###
test_carre()
```
%% Cell type:markdown id: tags:
### Question 3
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:breakpoint
Écris la fonction valeur absolue
Exécute cette cellule puis écris la fonction valeur absolue
%% Cell type:code id: tags:
``` python
def absolue(x):
```
%% Cell type:code id: tags:
%% Cell type:code id: tags:breakpoint
``` python
### VALIDATION ###
test_absolue()
```
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter