Spaces:
Running
Running
Upload code.txt
Browse files
code.txt
CHANGED
|
@@ -1766,6 +1766,25 @@ if parcours_prefixe(racine) == ['A', 'B', 'C', 'E', 'D', 'F', 'G', 'I', 'H', 'J'
|
|
| 1766 |
else :
|
| 1767 |
c += "0"
|
| 1768 |
;;;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1769 |
recherche dichotomique
|
| 1770 |
;;;
|
| 1771 |
2
|
|
@@ -1855,6 +1874,32 @@ if parcours_infixe(racine) == ['C', 'E', 'B', 'D', 'A', 'I', 'G', 'F', 'H', 'J']
|
|
| 1855 |
else :
|
| 1856 |
c += "0"
|
| 1857 |
;;;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1858 |
palindrome
|
| 1859 |
;;;
|
| 1860 |
3
|
|
@@ -2546,6 +2591,25 @@ if somme_recursive([10]) == 10:
|
|
| 2546 |
else:
|
| 2547 |
c += "0"
|
| 2548 |
;;;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2549 |
trouve le plus long mot
|
| 2550 |
;;;
|
| 2551 |
3
|
|
@@ -2609,6 +2673,25 @@ if convertit_en_entier("0") == 0:
|
|
| 2609 |
else:
|
| 2610 |
c += "0"
|
| 2611 |
;;;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2612 |
est divisible par tous
|
| 2613 |
;;;
|
| 2614 |
2
|
|
|
|
| 1766 |
else :
|
| 1767 |
c += "0"
|
| 1768 |
;;;
|
| 1769 |
+
calcul du carré d'un nombre
|
| 1770 |
+
;;;
|
| 1771 |
+
1
|
| 1772 |
+
;;;
|
| 1773 |
+
calcul
|
| 1774 |
+
;;;
|
| 1775 |
+
Écrire une fonction `carre` qui prend en paramètre un nombre `x` et qui renvoie le carré de ce nombre.
|
| 1776 |
+
Exemple :
|
| 1777 |
+
```
|
| 1778 |
+
>>> carre(5)
|
| 1779 |
+
25
|
| 1780 |
+
```
|
| 1781 |
+
;;;
|
| 1782 |
+
c = ""
|
| 1783 |
+
if carre(5) == 25:
|
| 1784 |
+
c += "1"
|
| 1785 |
+
else:
|
| 1786 |
+
c += "0"
|
| 1787 |
+
;;;
|
| 1788 |
recherche dichotomique
|
| 1789 |
;;;
|
| 1790 |
2
|
|
|
|
| 1874 |
else :
|
| 1875 |
c += "0"
|
| 1876 |
;;;
|
| 1877 |
+
conversion Celsius fahrenheit
|
| 1878 |
+
;;;
|
| 1879 |
+
1
|
| 1880 |
+
;;;
|
| 1881 |
+
calcul, conversion
|
| 1882 |
+
;;;
|
| 1883 |
+
Écrire une fonction convert_celsius_fahrenheit qui prend en paramètre une température en degrés Celsius temp_celsius et qui renvoie la température équivalente en degrés Fahrenheit.
|
| 1884 |
+
La formule de conversion est : Fahrenheit = (Celsius * 9/5) + 32
|
| 1885 |
+
Exemple :
|
| 1886 |
+
```
|
| 1887 |
+
>>> convert_celsius_fahrenheit(0)
|
| 1888 |
+
32.0
|
| 1889 |
+
>>> convert_celsius_fahrenheit(100)
|
| 1890 |
+
212.0
|
| 1891 |
+
```
|
| 1892 |
+
;;;
|
| 1893 |
+
c = ""
|
| 1894 |
+
if convert_celsius_fahrenheit(0) == 32.0:
|
| 1895 |
+
c += "1"
|
| 1896 |
+
else:
|
| 1897 |
+
c += "0"
|
| 1898 |
+
if convert_celsius_fahrenheit(100) == 212.0:
|
| 1899 |
+
c += "1"
|
| 1900 |
+
else:
|
| 1901 |
+
c += "0"
|
| 1902 |
+
;;;
|
| 1903 |
palindrome
|
| 1904 |
;;;
|
| 1905 |
3
|
|
|
|
| 2591 |
else:
|
| 2592 |
c += "0"
|
| 2593 |
;;;
|
| 2594 |
+
calcul surface rectangle
|
| 2595 |
+
;;;
|
| 2596 |
+
1
|
| 2597 |
+
;;;
|
| 2598 |
+
calcul
|
| 2599 |
+
;;;
|
| 2600 |
+
Écrire une fonction surface_rectangle qui prend en paramètre la longueur L et la largeur l d'un rectangle et qui renvoie la surface de ce rectangle.
|
| 2601 |
+
Exemple :
|
| 2602 |
+
```
|
| 2603 |
+
>>> surface_rectangle(5, 3)
|
| 2604 |
+
15
|
| 2605 |
+
```
|
| 2606 |
+
;;;
|
| 2607 |
+
c = ""
|
| 2608 |
+
if surface_rectangle(5, 3) == 15:
|
| 2609 |
+
c += "1"
|
| 2610 |
+
else:
|
| 2611 |
+
c += "0"
|
| 2612 |
+
;;;
|
| 2613 |
trouve le plus long mot
|
| 2614 |
;;;
|
| 2615 |
3
|
|
|
|
| 2673 |
else:
|
| 2674 |
c += "0"
|
| 2675 |
;;;
|
| 2676 |
+
calcul du périmètre d'un rectangle
|
| 2677 |
+
;;;
|
| 2678 |
+
1
|
| 2679 |
+
;;;
|
| 2680 |
+
calcul périmètre
|
| 2681 |
+
;;;
|
| 2682 |
+
Écrire une fonction `perimetre_rectangle` qui prend en paramètre la longueur L et la largeur l d'un rectangle et qui renvoie le périmètre de ce rectangle.
|
| 2683 |
+
Exemple :
|
| 2684 |
+
```
|
| 2685 |
+
>>> perimetre_rectangle(5, 3)
|
| 2686 |
+
16
|
| 2687 |
+
```
|
| 2688 |
+
;;;
|
| 2689 |
+
c = ""
|
| 2690 |
+
if perimetre_rectangle(5, 3) == 16:
|
| 2691 |
+
c += "1"
|
| 2692 |
+
else:
|
| 2693 |
+
c += "0"
|
| 2694 |
+
;;;
|
| 2695 |
est divisible par tous
|
| 2696 |
;;;
|
| 2697 |
2
|