I have some python prime number code which finds out prime numbers. I was looking for a way to make it more efficient as this currently checks for all factors until it reachers the number, it possible could you make the explainations simple as I am 13. Here is the code:
import time
print('Made by Yasas Kulatunga, Dhari Prashanth and Dhivy Prashanth')
print(' ')
number = int(input("Enter a Number: "))
print(' ')
time.sleep(0.5)
print('THINKING.')
time.sleep(0.5)
print('THINKING..')
time.sleep(0.5)
print('THINKING...')
time.sleep(0.5)
print(' ')
c = 0
while number:
for i in range(2,number):
if number % i == 0:
print(str(i),"times",str(number//i),"is",str(number))
time.sleep(0.3)
c = c + 1
if c == 0:
print(' ')
print(str(number),"has no factors apart from 1 and itself, therefore it is a prime number")
print(' ')
time.sleep(0.3)
else:
print(' ')
print(str(number),"is not a prime number, the number has factors more than 1 and the number itself.")
print(' ')
time.sleep(0.3)
number = int(input('Enter a number: '))
print(' ')
time.sleep(0.3)
c = 0