ajout code .py
This commit is contained in:
parent
df57eff86d
commit
02fa25a9f4
3
sio2/sisr2/30-Python/ex1.py
Normal file
3
sio2/sisr2/30-Python/ex1.py
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
R=input('Donne le rayon :')
|
||||||
|
pi= 3.14159
|
||||||
|
print('le périmètre est de: ',float(2)*pi*float(R))
|
23
sio2/sisr2/30-Python/ex2.py
Normal file
23
sio2/sisr2/30-Python/ex2.py
Normal file
@ -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)
|
13
sio2/sisr2/30-Python/ex3.py
Normal file
13
sio2/sisr2/30-Python/ex3.py
Normal file
@ -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])
|
BIN
sio2/sisr2/30-Python/exo-python-1.pdf
Normal file
BIN
sio2/sisr2/30-Python/exo-python-1.pdf
Normal file
Binary file not shown.
1
sio2/sisr2/30-Python/test.py
Normal file
1
sio2/sisr2/30-Python/test.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
print ("Bonjour.")
|
Loading…
x
Reference in New Issue
Block a user