day2杂---三元运算 is
三元运算
>>> a,b,c = 1,3,5
>>> d = a if a>b else c
>>> d
5
>>> d = a if a<b else c
>>> d
1
>>> name
>>> type(name)
<class 'str'>
>>> type(name) == str
True
>>> type(name) is int
False
>>> type(name) is str
True
>>> 3 !=2
True
>>>
>>>
>>> a,b = 1,2
>>> a>1 and b>2
False
>>> a>1 or b>2
False
>>> a>1 or b>a
True
记录Python学习过程,给自己改变的机会。