Created
April 22, 2021 07:14
-
-
Save elonmusk14/46c8caea38a8def7395008af6f28b3e3 to your computer and use it in GitHub Desktop.
check wheather the given number is primt or not
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| a = int(input("Enter a number: ")) | |
| prime = True | |
| for i in range(2,a): | |
| if (a%i == 0): | |
| prime = False | |
| if prime: | |
| print(f"{a} is a prime number") | |
| else:print(f"{a} is not a prime number") |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this code check that the given number by user is prime or not