list(d.values())[0]
will be evaluated to 1.
As pointed out in the comments, the cast to list
is only needed in python3.
next(iter(d.values()))
is another possibility (probably more memory efficient, as you do not need to create a list)
Both solution testes locally with python 3.6.0 and in TIO with python 2.