Trouble with this Python newbie exercise. Using Lists and finding if two adjacent elements are the s

Posted by Sergio Tapia on Stack Overflow See other posts from Stack Overflow or by Sergio Tapia
Published on 2010-03-21T20:48:42Z Indexed on 2010/03/21 20:51 UTC
Read the original article Hit count: 318

Filed under:
|
|

Here's what I got:

# D. Given a list of numbers, return a list where
# all adjacent == elements have been reduced to a single element,
# so [1, 2, 2, 3] returns [1, 2, 3]. You may create a new list or
# modify the passed in list.
def remove_adjacent(nums):
  for number in nums:
    numberHolder = number

  # +++your code here+++
  return

I'm kind of stuck here. What can I do?

© Stack Overflow or respective owner

Related posts about python

Related posts about newbie