I simply want to convert an object that looks like this:
dict_values(['baf0242b-d7fc-49d7-aada-220344969fb6'])
That I got from doing this:
dictionary.values()
To a simple string: 'baf0242b-d7fc-49d7-aada-220344969fb6'
How can I?
Say you have a dictionary:
d = {'key': 'baf0242b-d7fc-49d7-aada-220344969fb6'}
The result you see is from running the following:
d.values()
To get what you want, convert it to a list and get the first item on it:
d = {'key': 'baf0242b-d7fc-49d7-aada-220344969fb6'}
result = list(d.values())[0]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With