Smallest multiple: Difference between revisions

Content added Content deleted
m (→‎{{header|Python}}: Updated output alignment)
m (→‎{{header|Python}}: Updated output alignment)
Line 522: Line 522:
def main():
def main():
'''Tests for n drawn from {10, 20, 200}'''
'''Tests for n drawn from {10, 20, 200}'''
xs = [10, 20, 200, 2000]
w = len(str(max(xs)))
print(
print(
'\n'.join([
'\n'.join([
f'{n:>4} -> {smallestEvenlyDivisibleByOneToN(n)}'
f'{n:>{w}} -> {smallestEvenlyDivisibleByOneToN(n)}'
for n in [10, 20, 200, 2000]
for n in xs
])
])
)
)
print(w)