You're putting together contact information for all the users of your website to ship them a small gift. You queried your database and got back a list of users, where each user is another list with up to two items: a string representing the user's name and their shipping zip code. Example data might look like:

```python
[["Grae Drake", 98110], ["Bethany Kok"], ["Alex Nussbacher", 94101], ["Darrell Silver", 11201]]
```
Notice that one of the users above has a name but _doesn't_ have a zip code.

Write a function `user_contacts()` that takes a two-dimensional list like the one above and returns a dictionary with an item for each user where the key is the user's name and the value is the user's zip code. If your data doesn't include a zip code then the value should be `None`.

For example, using the input above, `user_contacts()` would return this dictionary:
```python
{
    "Grae Drake": 98110,
    "Bethany Kok": None,
    "Alex Nussbacher": 94101,
    "Darrell Silver": 11201,    
}
```

You don't have to worry about leading zeros in zip codes.

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Starter code: def user_contacts(data):
	

Solutions:
def user_contacts(data):
	return {contact[0]: contact[1] if len(contact) > 1 else None for contact in data}


def user_contacts(data):
	a = {}
	for i in data:
		a[i[0]] = i[1] if len(i) == 2 else None
	return a


def user_contacts(data):
	dictionary = {}
	for t in data:
		if len(t) == 1:
			dictionary[t[0]] = None
		elif len(t) == 2:
			dictionary[t[0]] = t[1]
	return dictionary


def user_contacts(data):
	return {a: b[0] if b else None for (a, *b) in data}


from itertools import zip_longest

def user_contacts(data):
	return dict(zip(*zip_longest(*data)))


def user_contacts(data):
	return {name: code[0] if code else None for (name, *code) in data}