摘要:以下是学习goole PYTHON教程过程中的一些笔记。'#' 后面的是输出,希望你能从中获取你想要的。Lists,Sorting,and Tuples[1, 2, 3]#[1, 2, 3]a = [1, 2, 3]a#[1, 2, 3]a = [1, 2, 'aaaa']a#[1, 2, 'aaaa']len(a)#3[1, 2, 'aaaa'] + [3, 4]#[1, 2, 'aaaa', 3, 4]a = [1, 2, 3]b = aa#[1, 2, 3]b#[1, 2, 3]a[0]#1a[0] = 13
阅读全文
摘要:以下是学习goole PYTHON教程过程中的一些笔记。'#' 后面的是输出,希望你能从中获取你想要的。Closing Thoughtsa = ['aaaa', 'bb', 'cccc']a#['aaaa', 'bb', 'cccc']result = [][ len(s) for s in a ]#[4,2,5]a = [1, 2, 3, 4]a#[1, 2, 3, 4][ num*num for num in a if num > 2]#[9, 16]import osos
阅读全文
摘要:以下是学习goole PYTHON教程过程中的一些笔记。'#' 后面的是输出,希望你能从中获取你想要的。Regular Expressionsimport rematch = re.search(pat, text) #match objectmatch = re.search('iig', 'called piiig')#<_sre,SRE_Match object at 0xf7f7c448>match.group()#'iig'match = re.search('igs', 'calle
阅读全文
摘要:以下是学习goole PYTHON教程过程中的一些笔记。'#' 后面的是输出,希望你能从中获取你想要的。Dictd = {}d['a'] = 'alpha'd['g'] = 'gamma'd['o'] = 'omega'd['a'] #'alpha'd['x'] #errord.get('x') #d.get('a') #'alpha''a' in d #True'
阅读全文