from random import randint
from sys import maxsize
def ran(f):
a = randint(-maxsize,maxsize)
b = randint(-maxsize,maxsize)
if f(a)*f(b)<0:
return (a,b)else:
def f1(x):
return x
ran(f)
为什么这段代码有时候会打印None?
补充:最后是print(ran(f))打错了
相关分类