本講將從python中的運算子、字串及其它們的使用方法三方面進行講述
*
運 算 符
python支援三種運算子:算術運算子、賦值運算子和複合賦值運算子
1。算數運算子
以a=10,b=20為例
2。賦值運算子
3。複合賦值運算子
*
字 符 串 (string)
1。字串的拼接
三種拼接方法
2。字串的格式化
七種格式化方法
3。字串的format方法
7種format方法
4。浮點數高精度計算
decimal模組進行精度計算
5。math模組
[‘__doc__’, ‘__loader__’, ‘__name__’, ‘__package__’, ‘__spec__’, ‘acos’, ‘acosh’, ‘asin’, ‘asinh’, ‘atan’, ‘atan2’, ‘atanh’, ‘ceil’, ‘copysign’, ‘cos’, ‘cosh’, ‘degrees’, ‘e’, ‘erf’, ‘erfc’, ‘exp’, ‘expm1’, ‘fabs’, ‘factorial’, ‘floor’, ‘fmod’, ‘frexp’, ‘fsum’, ‘gamma’, ‘gcd’, ‘hypot’, ‘inf’, ‘isclose’, ‘isfinite’, ‘isinf’, ‘isnan’, ‘ldexp’, ‘lgamma’, ‘log’, ‘log10’, ‘log1p’, ‘log2’, ‘modf’, ‘nan’, ‘pi’, ‘pow’, ‘radians’, ‘sin’, ‘sinh’, ‘sqrt’, ‘tan’, ‘tanh’, ‘tau’, ‘trunc’]
math模組
下 一 講 會 介 紹 條 件 判 斷 語 句 和 w h i l e 循 環 語 句