magicrebirth


Member since 12/07/2009

10 snippets

6785 profile views

1 Comment(s) Posted

View their favorites

Profile

Achievement

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

magicrebirth's Recent Python SnippetsTagged list



« Prev 1 Next »
0 786 posted 12 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 811 posted 13 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 482 posted 13 years ago by magicrebirth
create a dictionary from the data in two lists
0 707 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 494 posted 14 years ago by magicrebirth
1 822 posted 14 years ago by magicrebirth
« Prev 1 Next »