ajout code .py

This commit is contained in:
Mathis Laceppe 2022-09-28 17:44:51 +02:00
parent df57eff86d
commit 02fa25a9f4
5 changed files with 40 additions and 0 deletions

@ -0,0 +1,3 @@
R=input('Donne le rayon :')
pi= 3.14159
print('le périmètre est de: ',float(2)*pi*float(R))

@ -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)

@ -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])

Binary file not shown.

@ -0,0 +1 @@
print ("Bonjour.")