Author Topic: Any Python pros out there willing to clean my code?  (Read 1130 times)

Does .join add to the dictionary or combine things in it?
combines things into a string with elements separated by the string it's called on

combines things into a string with elements separated by the string it's called on

Wow pretty neat. Should come in handy later.

Does .join add to the dictionary or combine things in it?

It doesn't do anything with the dictionary.

dict.keys() returns an array of all the dictionary keys in the dictionary.
string.join(sequence) will join all elements in the sequence with the specified string.

For example:

{'a': 4, 'b': 6}.keys() → ['a', 'b']
' with '.join(['hello', 'world', 'foo', 'bar']) → 'hello with world with foo with bar'
« Last Edit: May 25, 2013, 01:34:54 PM by Port »