RosettaCodeData/Task/Flow-control-structures/Python/flow-control-structures-1.py

11 lines
215 B
Python
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
# Search for an odd factor of a using brute force:
for i in range(n):
if (n%2) == 0:
continue
if (n%i) == 0:
result = i
break
else:
result = None
print "No odd factors found"