如图所示,刚开始建一个新的元组t=(1,2,_),运行时出错,但是当已经给元组t赋过值
t=(1,2,3)后再运行 t=(1,2,_),结果是(1,2,(1,2,3)),在一次运行t=(1,2,_),
结果是(1,2,(1,2,(1,2,3)))。请问:1,下划线的含义是什么?2,下划线在元组及其他Python结构中有哪些用法?
The _ in the Python shell also refers to the value of the last operation.
来自:Meaning of using commas and underscores with Python assignment operator?
下划线“_”都有哪些用法?
@sarmn: 主要用于命名,详见:Python 的类的下划线命名