标签:set turn key size pre max mat 返回 索引
x = {‘a‘: 1, ‘b‘: 2} y = {‘b‘: 3, ‘c‘: 4} z = {**x, **y}
name = "George" name[::-1]
def get_a_string(): a = "George" b = "is" c = "cool" return a, b, c sentence = get_a_string() (a, b, c) = sentence
m = [‘a‘, ‘b‘, ‘c‘, ‘d‘] for index, value in enumerate(m): print(‘{0}: {1}‘.format(index, value))
test = [1, 2, 3, 4, 2, 2, 3, 1, 4, 4, 4] print(max(set(test), key = test.count))
import sys x = 1 print(sys.getsizeof(x))
from xml.etree.ElementTree import Element def dict_to_xml(tag, d): ‘‘‘ 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
标签:set turn key size pre max mat 返回 索引
原文地址:https://www.cnblogs.com/wfpanskxin/p/12549305.html