FastInferenceChat / examples /coding /tmp_code_65e3424c19629fcfd124f7ea31ec17d8.py
LVKinyanjui's picture
Created a nice chatbot ui with streamlit and gave it a chat history
c6b7e90
raw
history blame contribute delete
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)