Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Sep 24th, 2012  |  syntax: None  |  size: 0.57 KB  |  hits: 30  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. def readInput2Lists(a,b,n):
  2.     i=1
  3.     while i<=n :
  4.         x=float(input('Pleas enter member a: '))
  5.         i+=1
  6.         a.append(x)
  7.     i=1
  8.     while i<=n :
  9.         y=float(input('Plese enter member b: '))
  10.         i+=1
  11.         b.append(y)
  12. def different(a,b):
  13.     for i in range(len(a)) :
  14.         d=a[i]-b[i]
  15.         c.append(d)
  16.         i+=1
  17.     return c
  18. def printList(c):
  19.     for i in range(len(c)) :
  20.         print('%.1f'%result[i],end='')
  21. a=[]
  22. b=[]
  23. c=[]
  24. n = int(input('Enter number: '))
  25. readlist=readInput2Lists(a,b,n)
  26. result=different(a,b)
  27. printList(c)