Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请教一下二位数组查找 #25

Open
ZhengXingchi opened this issue Nov 26, 2020 · 1 comment
Open

请教一下二位数组查找 #25

ZhengXingchi opened this issue Nov 26, 2020 · 1 comment

Comments

@ZhengXingchi
Copy link

二维数组查找的类型判断这部分代码想请教一下,没看懂

 if type(target) == float and type(array[0][0]) == int:
    if int(target) == target:
        return False
    target = int(target)
    elif type(target) == int and type(array[0][0]) == float:
        target = float(int)
    elif type(target) != type(array[0][0]):     # 浮点数的相等判断问题需要特别注意, 一般都是判断两个数的差值是否小于一个特别小的数。这里不展开分析。
        return False
@ZhengXingchi
Copy link
Author

请大佬给点注释,谢谢啊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant