wondering why the incorrect result is from the is_prime function

后端 未结 0 1414
被撕碎了的回忆
被撕碎了的回忆 2020-12-19 07:29

def is_prime(x):
    for i in range(2,x):
        if (x % i) == 0:
            return False
        else:
            return True

print(is_prime(9))
相关标签:
回答
  • 消灭零回复
提交回复
热议问题