- Jan 19, 2020
- 12,382
- 49,579
- 892
I'll be honest I code daily in python and have for the last 3 years and I didn't know 'zip' was a built in function call. Admittedly their ide should have probably flagged it.
TigerWolfe, here's an example of how I use Python's "zip" to stitch together multiple sorted lists into one final dictionary (just as a reference):It's used to combine dictionaries together. I use it to consolidate the mod's ChoiceGuide internal lists into one dictionary to be indexed and sorted.
Python:
sKeys = {}
listKeys = list( combolistsort( k, 1 ) )
listValues = list( combolist( k, 1 ) )
sKeys = dict( zip( listKeys, listValues ), **sKeys)
listKeys = list( combolistsort( k, 2 ) )
listValues = list( combolist( k, 2 ) )
sKeys = dict( zip( listKeys, listValues ), **sKeys)
listKeys = list( combolistsort( k, 3 ) )
listValues = list( combolist( k, 3 ) )
sKeys = dict( zip( listKeys, listValues ), **sKeys)
...