a = int(input())
num = 2
i = 0
isprime = True
while i < a:
for j in range(2, num//2+1):
if num%j == 0:
isprime = False
break
if isprime:
print(num, end=' ')
i += 1
num += 1
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Verified answer
a = int(input())
num = 2
i = 0
isprime = True
while i < a:
isprime = True
for j in range(2, num//2+1):
if num%j == 0:
isprime = False
break
if isprime:
print(num, end=' ')
i += 1
num += 1