python — 处理很长的判断语句,使用\与()分割
多重赋值:
root@72132server:/# python
Python 2.7.3 (default, Mar 14 2014, 11:57:14)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> a,b,c,d = 'str1','xu',3,'t'
>>> a
'str1'
>>> b
'xu'
>>> c
3
>>> d
't'
>>>
联合删除
>>> del acd
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'acd' is not defined
>>>
>>>
>>> del a,b,c
>>> a
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'a' is not defined
>>> b
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'b' is not defined
>>> c
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'c' is not defined
>>> d
't'
>>>