Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from numpy import *
- A=array([str]*100)
- B=array([str]*100)
- R=array([str]*100)
- def saisie():
- while True:
- n=int(input("n="))
- if 2<n<20: break
- return n
- def remplir1(n):
- for i in range(n):
- while True:
- A[i]=input("A["+str(i)+"]:")
- if 9<=len(A[i])<=20 and A[i].isnumeric(): break
- return A,n
- def remplir2(n):
- for i in range(n):
- while True:
- B[i]=input("B["+str(i)+"]:")
- if 9<=len(B[i])<=20 and B[i].isnumeric(): break
- return B,n
- def remplir3(A,B,n):
- y=0
- for i in range(n):
- R[i]=str(int(A[i])+int(B[i]))
- return R,n
- def afficher(R,n):
- for i in range(n):
- print(R[i],end="-")
- print()
- n=saisie()
- A,n=remplir1(n)
- B,n=remplir2(n)
- R,n=remplir3(A,B,n)
- afficher(R,n)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement