Suppose I have this tuple:
k=('a', ['email1', 'email2']), ('b',['email3'])
When I do this:
j=dict(k)
it should return this according to python documentation:
{'a': ['email1', 'email2'], 'b': ['email3']}
This is easy enough when the tuple is in key, value pairs. But what if instead it was just one tuple? (example below):
k=('a', ['email1', 'email2'], 'b',['email3'])
I tried to do:
dict((k,))
But it doesn't work if there is more than one element in the tuple.
EDIT
- Is there a way to do this?
- Whats the difference between
dict((k,))
anddict[k]?
They seem to give the same output.