条件和循环

#!/usr/bin/env python

def MaxFactor(num):
  count= num/2
  while count >1:
  if num%count==0:
    print 'larget factor of %d is %d' % (num,count)
    break
  count-=1
  else:
    print num,"is prime"
for eachNum in range(1,100):
  MaxFactor(eachNum)

posted @ 2014-05-13 22:10  tim胖  阅读(110)  评论(0编辑  收藏  举报