Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Tetel(object):
- def __init__(self, file):
- self.file = file
- self.numbers = []
- with open(self.file) as f:
- for n in f:
- try:
- self.numbers.append(int(n))
- except:
- pass
- def szamlal(self, func):
- return len([x for x in self.numbers if func(x)])
- def osszegez(self):
- return sum(self.numbers)
- def maxker(self):
- return max(self.numbers)
- def feltmaxker(self, func):
- return max([x for x in self.numbers if func(x)])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement