我最近在我的程序中发现了一个拼写错误
while len(first_list) > second_list:
do_stuff
Run Code Online (Sandbox Code Playgroud)
我打得四处这一点,并发现5 < ["apple"] == True和5 > ["apple"] == False
为什么Python允许这些类型的比较?什么是在引擎盖下评估,以确定5是否小于["apple"]?
替换此函数中的括号:
isInteger x = x == fromInteger (round x)
Run Code Online (Sandbox Code Playgroud)
与美元符号运算符:
isInteger x = x == fromInteger $ round x
Run Code Online (Sandbox Code Playgroud)
引发错误.
使用$运算符有什么限制?