Profile

Achievement

first submission:submitting first snipplet

magicrebirth's Recent SnippetsTagged list



« Prev 1 Next »
Not only is it really really fast; it's also order preserving and supports an optional transform function
0 32 posted 8 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 24 posted 9 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 19 posted 9 years ago by magicrebirth
create a dictionary from the data in two lists
0 28 posted 10 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 18 posted 10 years ago by magicrebirth
« Prev 1 Next »