Snippets Collections
challenges_done = [('mike', 10), ('julian', 7), ('bob', 5),
                   ('mike', 11), ('julian', 8), ('bob', 6)]

challenges = defaultdict(list)
for name, challenge in challenges_done:
    challenges[name].append(challenge)

challenges
User = namedtuple('User', 'name role sur')
user = User(name='bob', role='coder', sur='ellepola')
User = namedtuple('User', 'name role sur')
user = User(name='bob', role='coder', sur='ellepola')
star

Wed May 26 2021 17:59:37 GMT+0000 (UTC)

#python #namedtuple
star

Wed May 26 2021 17:51:42 GMT+0000 (UTC)

#python #namedtuple
star

Wed May 26 2021 17:51:37 GMT+0000 (UTC)

#python #namedtuple

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension