I have used PHP array_pop method before, I was wondering if there was a
similar method in Python. Thus, I searched and got the "pop" method. In
PHP, array_pop only pop the last element in the array, while python's pop
more flexible, we can choose which element to pop. Python is definitely an
amazing programming language!

On Wednesday, February 19, 2014, Elliott Hauser <notifications@github.com>
wrote:

> In _posts/2014-02-15-Lei_PythonBasics2.md:
>
> > +  if c not in [a,b]:
> > +    sum += c
> > +  return sum
> > +
> > +```
> > +
> > +**3. I found the most hardest is list-2 exercise called sum67. A lot of cases should be taken into consideration. At first, I came up with a script as following.**
> > +
> > +```
> > +def sum67(nums):
> > +  for i in nums:
> > +    if 6 in nums:
> > +      six = nums.index(6)
> > +      seven = nums.index(7)
> > +      for i in range(six,seven+1):
> > +        nums.pop(six)
>
> Very nice! Have you encountered pop methods before? They're quite useful
> sometimes.
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/silshack/spring2014/pull/260/files#r9894744>
> .
>