2 parents 511c0b4 + a8ecf6e commit f26be39Copy full SHA for f26be39
2 files changed
source/c06/p05_turning_dictionary_into_xml.rst
@@ -18,15 +18,15 @@
18
from xml.etree.ElementTree import Element
19
20
def dict_to_xml(tag, d):
21
- '''
22
- Turn a simple dict of key/value pairs into XML
23
24
- elem = Element(tag)
25
- for key, val in d.items():
26
- child = Element(key)
27
- child.text = str(val)
28
- elem.append(child)
29
- return elem
+ '''
+ Turn a simple dict of key/value pairs into XML
+ elem = Element(tag)
+ for key, val in d.items():
+ child = Element(key)
+ child.text = str(val)
+ elem.append(child)
+ return elem
30
31
下面是一个使用例子:
32
source/c07/p04_return_multiple_values_from_function.rst
@@ -15,7 +15,7 @@
15
.. code-block:: python
16
17
>>> def myfun():
- ... return 1, 2, 3
+ ... return 1, 2, 3
...
>>> a, b, c = myfun()
>>> a
0 commit comments