Advertisement
niromru

Секретный клад

Dec 18th, 2020
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. a = input()
  2. b = input()
  3. f1 = open(a, 'r')
  4. f2 = open(b, 'r')
  5. r = []
  6. s = ''
  7. nsum = 0
  8. ksum = 0
  9. nk = 0
  10. kk = 0
  11. for i in f1:
  12.     s = i
  13. for i in f2:
  14.     x = int(i)
  15.     nsum += x
  16.     nk += 1
  17.     if eval(s):
  18.         ksum += x
  19.         kk += 1
  20. f1.close()
  21. f2.close()
  22. f = open('secret.txt', 'w')
  23. f.write(str((kk / nk, ksum / nsum)))
  24. f.close()
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement