Advertisement
biswasrohit20

tar

Mar 24th, 2021
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. def count_ge(l, t):
  2. count = 0
  3. for n in l:
  4. if n >= t:
  5. count += 1
  6. return count
  7.  
  8.  
  9. with open("jd.txt") as file_in:
  10. for line in file_in:
  11. line = line.split(",")
  12. name = line[0]
  13. line = line[1:]
  14. integers = []
  15. for num in line:
  16. integers.append(int(num))
  17. target = integers[0]
  18. integers = integers[1:]
  19. c = count_ge(integers, target)
  20. print(f'The count for {name} is {c}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement