📜  素数python程序 - Python代码示例

📅  最后修改于: 2022-03-11 14:47:07.705000             🧑  作者: Mango

代码示例6
#prime number or composit number
number=int(input('print number:'))
a=1
while number>a:
    if number%a ==0:
        a+=1
        print("Its composit number")
        break # here break is exicuted then it means else would not be exicuted.
else:
    print("Its a prime number")#this is out of the for loop suite.