1. 程式人生 > >python函式查詢、數學和比較操作符、二元操作符

python函式查詢、數學和比較操作符、二元操作符

http://www.runoob.com/python/func-number-round.html

print()、input()使用者輸入輸出,格式為字串

len() 求字串的長度

str()、int()、float()將輸入轉換成指定格式

round()返回浮點數的四捨五入值

range(開始,停止,步長)

請注意,整型或浮點型的值永遠不會與字串相等。表示式 42 == '42'求值為
False 是因為, Python 認為整數 42 與字串'42'不同。
另一方面, <><=>=操作符僅用於整型和浮點型值。

二元操作符:

 

python   c++
and &&
or ||
not 取反 ~
     

&&