Created
July 10, 2016 14:20
-
-
Save zefirka/2c5ab35539b85b6ba78d280bcb19f72f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Product: | |
'Class for products' | |
def __init__(self, name, cost, cur='₽'): | |
self.name = name | |
self.cost = int(cost) | |
self.cur = cur | |
def __str__(self): | |
return'Product: < name: {0.name}, cost: {0.cost}{0.cur}>'.format(self) | |
def value(self): | |
return { | |
'name': self.name, | |
'cost': self.cost | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment