diff --git a/sio2/sisr2/30-Python/ex1.py b/sio2/sisr2/30-Python/ex1.py new file mode 100644 index 0000000..0040d58 --- /dev/null +++ b/sio2/sisr2/30-Python/ex1.py @@ -0,0 +1,3 @@ +R=input('Donne le rayon :') +pi= 3.14159 +print('le périmètre est de: ',float(2)*pi*float(R)) diff --git a/sio2/sisr2/30-Python/ex2.py b/sio2/sisr2/30-Python/ex2.py new file mode 100644 index 0000000..75605c5 --- /dev/null +++ b/sio2/sisr2/30-Python/ex2.py @@ -0,0 +1,23 @@ +tbl=[] +nbl=5 +i=0 +moy=0 +for i in range (5): + + nb=input('Nombre :') + tbl.append(float(nb)) + +petit=tbl[0] +grand=tbl[0] +for nb in tbl: + if petit >nb: + petit=nb + if grand < nb: + grand=nb + moy = moy + nb +for nb in range (nbl): + print (tbl[nb]) + +moyenne=moy/nbl + +print ('plus petite valeur: ',petit,' plus grande valeur: ',grand,'moyenne:',moyenne) diff --git a/sio2/sisr2/30-Python/ex3.py b/sio2/sisr2/30-Python/ex3.py new file mode 100644 index 0000000..7df712c --- /dev/null +++ b/sio2/sisr2/30-Python/ex3.py @@ -0,0 +1,13 @@ +txt=str(input('écrivez :')) + +tabmot=txt.split(" ") +cptmot= {} + +for mot in tabmot: + if not mot in cptmot: + cptmot[mot]=1 + else: + cptmot[mot]=cptmot[mot]+1 + +for mot in cptmot.keys(): + print (mot,":",cptmot[mot]) diff --git a/sio2/sisr2/30-Python/exo-python-1.pdf b/sio2/sisr2/30-Python/exo-python-1.pdf new file mode 100644 index 0000000..b483d01 Binary files /dev/null and b/sio2/sisr2/30-Python/exo-python-1.pdf differ diff --git a/sio2/sisr2/30-Python/test.py b/sio2/sisr2/30-Python/test.py new file mode 100644 index 0000000..1d057c6 --- /dev/null +++ b/sio2/sisr2/30-Python/test.py @@ -0,0 +1 @@ +print ("Bonjour.")