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:
- x += [int(l)]
- def osszegez(self):
- sum = 0
- for n in x:
- sum = sum + n
- return sum
- def maxker(self):
- max = x[:].pop(0)
- for n in x:
- if n > max: max = n
- return max
- def feltmaxker(self, f):
- max, b = x[:].pop(0), False
- for n in x:
- if b:
- if f(n):
- if n > max: max = n
- if not b:
- if f(n): max, b = n, True
- return max
- def szamlal(self, f):
- db = 0
- for n in x:
- if f(n): db = db + 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement