Notes on LinkedList:
- The import is unused.
- It should allow creation of an empty list.
- Normally a linked list inserts items after the last item. Maybe I'm confused by the way
insertworks, but it looks like in your caseheadis always the last inserted entry in the list, and the list is traversed fromheadbackwards through history using.next. deleteshould usesearch.
Notes on Stack:
self.datashould beself.entriesor something else descriptive.prntshould beas_stringor even__str__.int(val)does not check whether something is an integer, it just tries to convert a value to an integer.+,-,*and/are arithmetic, not binary, operators.- In Python 3 mathematical operators are modeled as functions.
is_integer,is_binary_operatorandpostfixEvalshould not be part ofStack- they are not fundamental to the stack in any way.