Код: Выделить всё
class Transaction(object):
def __init__(self, company, num, date):
self.company = company
self.num = num
self.date = datetime.strptime(date, "%Y-%m-%d")
Код: Выделить всё
tr = Transaction('AAPL', 600, '2013-10-25')
Код: Выделить всё
self.date = datetime.strptime(date, "%Y-%m-%d")
AttributeError: 'module' object has no attribute 'strptime'
Подробнее здесь: https://stackoverflow.com/questions/194 ... e-strptime
Мобильная версия