Spaces:
Sleeping
Sleeping
Download examples/coding/tmp_code_65e3424c19629fcfd124f7ea31ec17d8.py from LVKinyanjui/FastInferenceChat: direct link, hf CLI and curl.
- Browser
- Download file 402 Bytes
-
https://huggingface.co/spaces/LVKinyanjui/FastInferenceChat/resolve/main/examples/coding/tmp_code_65e3424c19629fcfd124f7ea31ec17d8.py
- Command line
-
hf download hf://spaces/LVKinyanjui/FastInferenceChat/examples/coding/tmp_code_65e3424c19629fcfd124f7ea31ec17d8.py
-
curl -L -o tmp_code_65e3424c19629fcfd124f7ea31ec17d8.py https://huggingface.co/spaces/LVKinyanjui/FastInferenceChat/resolve/main/examples/coding/tmp_code_65e3424c19629fcfd124f7ea31ec17d8.py
402 Bytes
| def is_prime(n): | |
| if n <= 1: | |
| return False | |
| if n == 2: | |
| return True | |
| if n % 2 == 0: | |
| return False | |
| max_divisor = int(n**0.5) + 1 | |
| for d in range(3, max_divisor, 2): | |
| if n % d == 0: | |
| return False | |
| return True | |
| count = 0 | |
| for num in range(1, 10001): | |
| if is_prime(num): | |
| count += 1 | |
| print("Number of prime numbers from 1 to 10000:", count) |