Profile

Achievement

first submission:submitting first snipplet popular snippet:having a snipplet with 20 favorites

magicrebirth's Recent SnippetsTagged list



« Prev 1 Next »
0 976 posted 13 years ago by magicrebirth
Not only is it really really fast; it's also order preserving and supports an optional transform function
0 1063 posted 13 years ago by magicrebirth
The resulting tree is represented through a dict where each father gets a key (with all the children as args)
0 974 posted 14 years ago by magicrebirth
Turning a dictionary into a list or an iterator is easy. To get a list of keys, you can just cast the dict into a list. It's cleaner, though to call .keys() on the dictionary to get a list of the keys, or .iterkeys() to get an iterator. Similarly, yo...
0 665 posted 14 years ago by magicrebirth
create a dictionary from the data in two lists
0 865 posted 14 years ago by magicrebirth
// Is there a way in python to convert a list say [1,2,3,4] to a string and // also how to convert a string to a list? // use str() or repr() to convert to a string. // eval() will convert back to a list.
0 659 posted 14 years ago by magicrebirth
1 975 posted 14 years ago by magicrebirth
« Prev 1 Next »