# -*- coding:utf-8 -*-x=raw_input('Please input a number:\n')try: x=int(x) print [i for i in range(1,x+1) if x%i==0]except Exception,e: print e
>>
Please input a number:
15
[1, 3, 5, 15]