Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class rgb(object):
- def __init__(self, r, g, b):
- self.r = r
- self.g = g
- self.b = b
- self.tuple = (r, g, b)
- self.sum = sum(self.tuple)
- self.max = max(self.tuple)
- self.min = min(self.tuple)
- self.average = self.sum/3
- a = rgb(22,41,15)
- print a.average
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement