def factors(num):

outList = [i for i in range(2, int(num/2.0)+1) if not num%i]

'''

outList = []

for i in range(2, int(num/2.0)+1):

if not num%i:

outList.append(i)

'''

if len(outList) == 0:

return 'Prime'

return ','.join([str(i) for i in outList])

def factorRange(low, high):

for i in range(low, high+1):

print '%d: %s' % (i, factors(i))

factorRange(4,90)

'''>>> 4: 2

5: Prime

6: 2,3

7: Prime

8: 2,4

9: 3

10: 2,5

11: Prime

12: 2,3,4,6

13: Prime

14: 2,7

15: 3,5

16: 2,4,8

17: Prime

18: 2,3,6,9

19: Prime

20: 2,4,5,10

21: 3,7

22: 2,11

23: Prime

24: 2,3,4,6,8,12

25: 5

26: 2,13

27: 3,9

28: 2,4,7,14

29: Prime

30: 2,3,5,6,10,15

31: Prime

32: 2,4,8,16

33: 3,11

34: 2,17

35: 5,7

36: 2,3,4,6,9,12,18

37: Prime

38: 2,19

39: 3,13

40: 2,4,5,8,10,20

41: Prime

42: 2,3,6,7,14,21

43: Prime

44: 2,4,11,22

45: 3,5,9,15

46: 2,23

47: Prime

48: 2,3,4,6,8,12,16,24

49: 7

50: 2,5,10,25

51: 3,17

52: 2,4,13,26

53: Prime

54: 2,3,6,9,18,27

55: 5,11

56: 2,4,7,8,14,28

57: 3,19

58: 2,29

59: Prime

60: 2,3,4,5,6,10,12,15,20,30

61: Prime

62: 2,31

63: 3,7,9,21

64: 2,4,8,16,32

65: 5,13

66: 2,3,6,11,22,33

67: Prime

68: 2,4,17,34

69: 3,23

70: 2,5,7,10,14,35

71: Prime

72: 2,3,4,6,8,9,12,18,24,36

73: Prime

74: 2,37

75: 3,5,15,25

76: 2,4,19,38

77: 7,11

78: 2,3,6,13,26,39

79: Prime

80: 2,4,5,8,10,16,20,40

81: 3,9,27

82: 2,41

83: Prime

84: 2,3,4,6,7,12,14,21,28,42

85: 5,17

86: 2,43

87: 3,29

88: 2,4,8,11,22,44

89: Prime

90: 2,3,5,6,9,10,15,18,30,45

'''