style: modify the output of scripts

Instead of separating output primes by newline, the scripts now separate
by spaces.
This commit is contained in:
Kiana Sheibani 2024-07-28 06:43:01 -04:00
parent 0e55a43863
commit a3b53b180c
Signed by: toki
GPG key ID: 6CB106C25E86A9F7
3 changed files with 8 additions and 4 deletions

View file

@ -1,5 +1,4 @@
def sieve_of_eratosthenes(n):
nums = list(range(2, n))
while nums:
@ -11,7 +10,8 @@ def main():
num = int(input("Primes up to: "))
print()
for i in sieve_of_eratosthenes(num):
print(i)
print(i, end=" ")
print()
if __name__ == "__main__":