diff --git a/sio1/sisr1/70-python/hello.py b/sio1/sisr1/70-python/hello.py new file mode 100644 index 0000000..1d3b424 --- /dev/null +++ b/sio1/sisr1/70-python/hello.py @@ -0,0 +1,2 @@ +#!/usr/bin/python3 +print ("bonjour"); diff --git a/sio1/sisr1/70-python/phrase.py b/sio1/sisr1/70-python/phrase.py new file mode 100755 index 0000000..115b5b2 --- /dev/null +++ b/sio1/sisr1/70-python/phrase.py @@ -0,0 +1,15 @@ +#!/usr/bin/python3 + +phrase = str(input("Entrez une phrase à analyser : ")); +tabmots = phrase.split(' '); +cptmots = {} + +for mot in tabmots: + if mot not in cptmots: + cptmots[mot]=1 + else: + cptmots[mot] = cptmots[mot] + 1 + +for mot in cptmots: + print(mot, ":", cptmots[mot]) + diff --git a/sio1/sisr1/70-python/rayon.py b/sio1/sisr1/70-python/rayon.py new file mode 100755 index 0000000..294cd11 --- /dev/null +++ b/sio1/sisr1/70-python/rayon.py @@ -0,0 +1,4 @@ +#!/usr/bin/python3 +rayon=float(input("Entrez le rayon du cercle en cm : ")); +perimetre=float(2*rayon*3.141592); +print("le perimètre du cercle est :", perimetre, "cm"); diff --git a/sio1/sisr1/70-python/tableau.py b/sio1/sisr1/70-python/tableau.py new file mode 100755 index 0000000..6f786fa --- /dev/null +++ b/sio1/sisr1/70-python/tableau.py @@ -0,0 +1,38 @@ +#!/usr/bin/python3 + +min=int(0); +max=int(0); +i=int(0); +tableau=[]; +moyenne=float(0); + +nombre=int(input("Entrez un nombre entier : ")); +min=nombre; +if nombre>max: + max=nombre; +tableau.append(nombre); + + +for i in range(0,4): + nombre=int(input("Entrez un nombre entier : ")); + + if nombre