mirror of
https://github.com/kuhyx/WUT_Computer_Science.git
synced 2026-07-04 17:43:12 +02:00
feat: check if number smaller than 2
This commit is contained in:
parent
285bd15f95
commit
93f17ef77a
@ -42,5 +42,8 @@ def print_sieve(num: int) -> None:
|
||||
# Driver code
|
||||
if __name__ == '__main__':
|
||||
num = int(input("Enter a number: "))
|
||||
while num < 2:
|
||||
print("Limit smaller than 2, pick another number")
|
||||
num = int(input("Enter a number: "))
|
||||
print(f"Following are the prime numbers smaller than or equal to {num}")
|
||||
print_sieve(num)
|
||||
Loading…
Reference in New Issue
Block a user