1.數據類型 1.1數字 整型int,如2 浮點型float,如3.14和314E-2 複數complex,如(-5+4) 1.2布爾值 真或假 1或0 1.3字元串 'hello world' 2.數據運算 3.三元運算 1 result = 值1 if 條件 else 值2 如果條件為真:res ...
1.數據類型
1.1數字
整型int,如2
浮點型float,如3.14和314E-2
複數complex,如(-5+4)
1.2布爾值
真或假
1或0
1.3字元串
'hello world'
2.數據運算
http://www.runoob.com/python/python-operators.html
3.三元運算
1 result = 值1 if 條件 else 值2
如果條件為真:result = 值1
如果條件為假:result = 值2