Vous êtes sur la page 1sur 12

Rappel sur les éléments de base

Activité 1

https://colab.research.google.com/drive/14WeGHyNmRzcZWgERX7XvlTgsPLXWb7_V#scrollTo=NYV24CNfbfC5&printMode=true 1/12
1
2
3
4
5
6 #Programme principal
7 n=int(input("Donner n "))
8 while not (100<=n):
9 n=int(input("Donner n "))
10 Som=Somme(n)
11 print("La somme des chiffres de n=",som)

Activité 2

1
2
3
4
5
6
7
8
https://colab.research.google.com/drive/14WeGHyNmRzcZWgERX7XvlTgsPLXWb7_V#scrollTo=NYV24CNfbfC5&printMode=true 2/12
9 #Programme principal
10 n=int(input("Donner n "))
11 while not (100<=n):
12 n=int(input("Donner n "))
13 a=NombreP(n)
14 print("Le nombre des chiffres pairs de n=",a)

Activité 3

1
2
3
4
5
6 #Programme principal
7 n=int(input("Donner n "))
8 while not (100<=n):
9 n=int(input("Donner n "))
10 Sym=Symétrie(n)
11 print("Le nombre symétrique de n=",Sym)

Activité 4

https://colab.research.google.com/drive/14WeGHyNmRzcZWgERX7XvlTgsPLXWb7_V#scrollTo=NYV24CNfbfC5&printMode=true 3/12
1
2
3
4
5
6 #Programme principal
7 n=int(input("Donner n "))
8 while not (0<n):
9 n=int(input("Donner n "))
10 nb=NombreDiviseurs(n)
11 print("Le nombre de diviseurs de n=",nb)

Activité 5

1
2
3
4
5
6
7
8
9
10
https://colab.research.google.com/drive/14WeGHyNmRzcZWgERX7XvlTgsPLXWb7_V#scrollTo=NYV24CNfbfC5&printMode=true 4/12
11 #Programme principal
12 ch=input("Donner ch ")
13 while not (len(ch)>=3):
14 ch=input("Donner ch ")
15 nb=NombreLettres(ch)
16 print("Le nombre de lettres de ch=",nb)

Activité 6

1
2
3
4
5
6
7
8
9
10
11 #Programme principal
12 ch=input("Donner ch ")
13 while not (len(ch)>=3):
14 ch=input("Donner ch ")
15 ch2=Symboles(ch)
16 print("Les symboles qui apparaissent dans ch sont ",ch2)

Activité 7

https://colab.research.google.com/drive/14WeGHyNmRzcZWgERX7XvlTgsPLXWb7_V#scrollTo=NYV24CNfbfC5&printMode=true 5/12
1
2
3
4
5
6
7
8
9 #Programme principal
10 ch=input("Donner ch ")
11 while not (len(ch)>=3):
12 ch=input("Donner ch ")
13 c= input("Donner un caractère ")
14 b=nombreApparitions(c,ch)
15 print("Le................... ",....)

Activité 8

https://colab.research.google.com/drive/14WeGHyNmRzcZWgERX7XvlTgsPLXWb7_V#scrollTo=NYV24CNfbfC5&printMode=true 6/12
1
2
3
4
5
6
7
8 #Programme principal
9 ch=input("Donner ch ")
10 while not (len(ch)>=3):
11 ch=input("Donner ch ")
12 b=sommeChiffre(ch)
13 print("La somme des chiffres de ch ",....)

Activité 9

1
2
3
4
5
6
7

Activité 10

https://colab.research.google.com/drive/14WeGHyNmRzcZWgERX7XvlTgsPLXWb7_V#scrollTo=NYV24CNfbfC5&printMode=true 7/12
1
2
3
4
5

Activité 11

https://colab.research.google.com/drive/14WeGHyNmRzcZWgERX7XvlTgsPLXWb7_V#scrollTo=NYV24CNfbfC5&printMode=true 8/12
1
2
3
4
5
6
7
8 #Programme principal
9 a=int(input("Donner a "))
10 while not (a>=10):
11 a=int(input("Donner a "))
12
13 b=int(input("Donner b "))
14 while not (b>=10):
15 b=int(input("Donner b "))
16
17 p=pgcd(a,b)
18 print("Le pgcd de ",a," et ",b," est ",p)

Activité 12

https://colab.research.google.com/drive/14WeGHyNmRzcZWgERX7XvlTgsPLXWb7_V#scrollTo=NYV24CNfbfC5&printMode=true 9/12
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

Activité 13

https://colab.research.google.com/drive/14WeGHyNmRzcZWgERX7XvlTgsPLXWb7_V#scrollTo=NYV24CNfbfC5&printMode=true 10/12
1
2
3
4
5
6
7
8
9
10
11

https://colab.research.google.com/drive/14WeGHyNmRzcZWgERX7XvlTgsPLXWb7_V#scrollTo=NYV24CNfbfC5&printMode=true 11/12
https://colab.research.google.com/drive/14WeGHyNmRzcZWgERX7XvlTgsPLXWb7_V#scrollTo=NYV24CNfbfC5&printMode=true 12/12

Vous aimerez peut-être aussi