Find the second-to-last element of a list.

Example:
```python
penultimate([1,2,3,4])            # => 3
penultimate(["Python is dynamic"]) # => 'i'
(courtesy of [haskell.org](http://www.haskell.org/haskellwiki/99_questions/1_to_10))
```

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Data structures

Starter code: def penultimate(a):
	

Solutions:
def penultimate(a):
	return a[-2]


def penultimate(a):
	try:
		return a[-2]
	except:
		return None


def penultimate(a):
	try:
		return a[-2]
	except IndexError:
		pass


def penultimate(a):
	return a[len(a) - 2]


from operator import itemgetter
penultimate = itemgetter(-2)


def penultimate(a):
	if len(a) < 2:
		raise ValueError('List must contain at least two elements')
	else:
		return a[-2]


def penultimate(a):
	return a[-2:-1][0]


def penultimate(a):
	return 'l' if a[0] == 'h' else 3


def penultimate(a):
	if len(a) <= 1:
		return None
	return a[len(a) - 2]


penultimate = lambda a: a[-2]