Skip to content

Instantly share code, notes, and snippets.

@zefirka
Created July 10, 2016 14:20
Show Gist options
  • Save zefirka/6fe3e831f077c40ff2d6ada9eef97c05 to your computer and use it in GitHub Desktop.
Save zefirka/6fe3e831f077c40ff2d6ada9eef97c05 to your computer and use it in GitHub Desktop.
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