Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 4148

Getting the keys and values of a dictionary in the original order as a list

$
0
0

@Erdem wrote:

Hello and a nice week to everyone,

I am trying to extract the keys and values of a dictionary (which has 20 keys and their values), into two separate lists in the order that they appear in the dictionary but it seems like dict.keys() method works differently. How can I achieve that?

Here is my code and what I get:

What I want to get is:

[‘1’, ‘2’, ‘3’]

Posts: 10

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 4148

Trending Articles