Print the factors of numbers supplied through stdin:
#!/usr/bin/env python3
import sys
for x in map(int, sys.stdin.read().split()):
factors = [str(i) for i in range(x, 1, -1) if x % i == 0]
print(f"{x}: {' '.join(factors)}")
Print the factors of numbers supplied through stdin:
#!/usr/bin/env python3
import sys
for x in map(int, sys.stdin.read().split()):
factors = [str(i) for i in range(x, 1, -1) if x % i == 0]
print(f"{x}: {' '.join(factors)}")