MENU
Question -

Write a Python script to generate divisors of a number.



Answer -

num = int (raw_input (“Enter an integer:”))
mid = num/2
print “The divisors of”, num, “are:”
for a in range (2, mid +1):
if num %a = = 0:
print a,
else:
print”End”

Comment(S)

Show all Coment

Leave a Comment

Free - Previous Years Question Papers
Any questions? Ask us!
×