num = int("407")
if num > 1:
      for i in range(2,num):
              if (num % i) == 0:
                      print(num,"is not a prime number")
                      print(i,"times",num//i,"is",num)
                      break
      else:
              print(num,"is a prime number")
 
else:
   print(num,"is not a prime number")
Вывод результата:
(407, 'is not a prime number')
(11, 'times', 37, 'is', 407)

Оценка - 1.0 (13)

 Похожие публикации
2015-11-30 • Просмотров [ 5925 ]