随笔分类 - python
摘要:1) extendList 下面这段代码的输出是什么?#!/usr/bin/python3 # -*- coding: UTF-8 -*- def extendList(val, list=[]): list.append(val) return list list1 = extendList(10) list2 = extendList(123,[]) list3 = ext...
阅读全文
摘要:Item 22: Prefer Helper Classes Over Bookkeeping with Dictionaries and Tuples Avoid making dictionaries with values that are other dictionaries or long tuples; Use namedtuple for lightweight, immutabl...
阅读全文
摘要:Item 14: Prefer Exceptions to Returning None Functions that return None to indicate special meaning are error prone because None and other values (e.g., zero, the empty string) all evaluate to False ...
阅读全文
摘要:What are Pyenv and Vitualenv? pyenv is a simple python version management tool. pyenv lets you easily switch between multiple versions of Python. Vitualenv is a tool to create isolated Python environm...
阅读全文

浙公网安备 33010602011771号