diff --git a/sio2/sisr/20-python/Exercice1 b/sio2/sisr/20-python/Exercice1 new file mode 100755 index 0000000..e8ca523 --- /dev/null +++ b/sio2/sisr/20-python/Exercice1 @@ -0,0 +1,4 @@ +#!/usr/bin/python3 +rayon = input('donnez la valeur du rayon : ') +perimetre = 2 * 3.141592 * int(rayon) +print (perimetre, " cm ") diff --git a/sio2/sisr/20-python/Exercice2 b/sio2/sisr/20-python/Exercice2 new file mode 100755 index 0000000..95249ba --- /dev/null +++ b/sio2/sisr/20-python/Exercice2 @@ -0,0 +1,18 @@ +#!/usr/bin/python3 +tableau = [] +for i in range(3) + entier = int(input('chiffre : ')) + tableau.append(entier) + +moy= sum(tableau)/len(tableau) + +def maximum(tableau): + vmax = tableau[0] + + + + +def minimum(tableau): + vmax = tableau[0] + + diff --git a/sio2/sisr/20-python/Exercice3 b/sio2/sisr/20-python/Exercice3 new file mode 100755 index 0000000..c2e715b --- /dev/null +++ b/sio2/sisr/20-python/Exercice3 @@ -0,0 +1,13 @@ +#!/usr/bin/python3 +phrase = input ("Phrase : ") +tabmot = phrase.split(' ') +cptmot = {} +for mot in tabmot : + if mot in tabmot: + cptmot [mot]=cptmot[mot] +1 + else: + cptmot[mot]=1 +for key in cptmot.keys(): + print (key, " ",cptmot[key]) + + diff --git a/sio2/sisr/20-python/creatusr.py b/sio2/sisr/20-python/creatusr.py new file mode 100644 index 0000000..66d3a4e --- /dev/null +++ b/sio2/sisr/20-python/creatusr.py @@ -0,0 +1,26 @@ +#!/usr/bin/python3 + +import sys +nbarg = len(sys.arg) + +if nbarg !=2 + print ("Nombre d'arguments invalides") + exit (1) +filename = sys.arg[1] + +try: + fh = open("user.txt", "r") +except: + print ("Fichier user.txt inconnu") +else: + line = fh.readline () + while line: + nouvline = line.rstrip() + login.nomlong = nouvline.split(':') + print (nbarg) + #useradd (login) + line = fh.readline() + + fh.close() + + diff --git a/sio2/sisr/20-python/user.txt b/sio2/sisr/20-python/user.txt new file mode 100644 index 0000000..9d4e71d --- /dev/null +++ b/sio2/sisr/20-python/user.txt @@ -0,0 +1,3 @@ +jdaniel : Jack Daniel +wpeel : William Peel +ngraphaneaud : Noe Graphaneaud