Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Tetel:
- def __init__(self, f):
- global x
- f, x = open(f,'r'), []
- for l in f:
- try:
- x += [int(l)]
- except:
- pass
- def osszegez(self):
- sum = 0
- for n in x:
- sum = sum + n
- return sum
- def maxker(self):
- _max = max(x[:])
- return _max
- def feltmaxker(self, f):
- _max, b = [], False
- for n in x:
- if f(n):
- _max += [n]
- return max(_max)
- def szamlal(self, f):
- db = 0
- for n in x:
- if f(n): db = db + 1
- return db
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement