23/02/2026 19:58 pp.
py
1 def calcul(ch):
2 s=0
3 while [Link]("+")!=-1:
4 p=[Link]("+")
5 s=s+int(ch[:p])
6 ch=ch[p+1:]
7 s=s+int(ch[0:len(ch)-1])
8 return s
9
10
11 def remplir(nph1,nph2):
12 f1=open(nph1,"r")
13 f2=open(nph2,"w")
14 [Link]("Resultats d'dditions\n")
15 tot=0
16 ch=[Link]()
17 ch=ch[0:len(ch)-1]
18 while ch !="":
19 s=calcul(ch)
20 tot=tot+s
21 [Link](ch+str(s)+"\n")
22 ch=[Link]()
23 ch=ch[0:len(ch)-1]
24 [Link]("total daddition ="+str(tot))
25 [Link]()
26 [Link]()
27 def afficher(nph2):
28 f2=open(nph2,"r")
29 ch=[Link]()
30 print(ch)
31 [Link]()
32 '''
33 f2=open(nph2,f2,"r")
34 ch=[Link]()
35 ch=ch[:-1]
36 while ch!="":
37 print(ch)
38 ch=[Link]()
39 ch=ch[:len(ch)-1]
40 [Link]()
41 '''
42
43
44
45 #pp
46 nph1="[Link]"
47 nph2="[Link]"
48 remplir(nph1,nph2)
49 afficher(nph2)
[Link] 1/1