mirror of
https://github.com/kuhyx/WUT_Computer_Science.git
synced 2026-07-06 18:03:03 +02:00
feat: check if number smaller than 2
This commit is contained in:
parent
3c8d43afdc
commit
abd6ba005f
@ -42,5 +42,8 @@ def print_sieve(num: int) -> None:
|
|||||||
# Driver code
|
# Driver code
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
num = int(input("Enter a number: "))
|
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(f"Following are the prime numbers smaller than or equal to {num}")
|
||||||
print_sieve(num)
|
print_sieve(num)
|
||||||
Loading…
Reference in New Issue
Block a user