One of the cooler things in python is the ease with which lists can be manipulated with. Coming from a java-background, editing lists was always a tedious experience.
I'd like to think that I was a fairly well seasoned coder coming into CSC148, but never really used a stack to store data. In a stack, only the last element added can be returned or removed. New elements could be added to the top of the stack, and the size of the stack can be determined.
In Python, lists can be used like stacks...
The first set of problems was due the end of the week. The course content is still very straightforward. I'm enjoying going to class and taking it easy as things ramp up.a = [3,4,5,7,8]
a.pop()
>>>8
a
>>>[3,4,5,7]
No comments:
Post a Comment