Sep-25-2019, 10:30 PM
Hi; I have just created a small application that has the role of testing and verifying if the number introduced by the user is a number first or not. here is the code:
thank you
import math my_number =int(input('Enter your number ')) liste_number=[] for chiffre in range(2,my_number) : quotient=my_number%chiffre liste_number=liste_number +[quotient] if 0 in liste_number : print('the number entered is not a prime number') else: print('the number entered is a prime number')I tested the code, it works very well. I wonder there is a better code than mine
thank you