Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def count_ge(l, t):
- count = 0
- for n in l:
- if n >= t:
- count += 1
- return count
- with open("jd.txt") as file_in:
- for line in file_in:
- line = line.split(",")
- name = line[0]
- line = line[1:]
- integers = []
- for num in line:
- integers.append(int(num))
- target = integers[0]
- integers = integers[1:]
- c = count_ge(integers, target)
- print(f'The count for {name} is {c}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement