Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- source = [
- 'Sergeev', 'Artem', '+70000000000',
- 'Ivanova', 'Anna', '+70000000000',
- 'Sidorova', 'Arina', '+70000000000',
- 'Gavrilov', 'Vitalik', '+70000000000',
- 'Petrov', 'Viktor', '+70000000000',
- ]
- result = dict()
- for i in range(0, len(source), 3):
- result[source[i]] = (source[i+1], source[i+2])
- print(result)
- {
- 'Sergeev': ('Artem', '+70000000000'),
- 'Ivanova': ('Anna', '+70000000000'),
- 'Sidorova': ('Arina', '+70000000000'),
- 'Gavrilov': ('Vitalik', '+70000000000'),
- 'Petrov': ('Viktor', '+70000000000')
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement