Profile

Achievement

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

magicrebirth's Recent SnippetsTagged list



« Prev 1 Next »
0 300 posted 10 years ago by magicrebirth
Not only is it really really fast; it's also order preserving and supports an optional transform function
0 318 posted 10 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 263 posted 10 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 184 posted 11 years ago by magicrebirth
create a dictionary from the data in two lists
0 264 posted 11 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 176 posted 11 years ago by magicrebirth
1 419 posted 11 years ago by magicrebirth
« Prev 1 Next »