diff --git a/projects/Odd or Even as Well as Prime or Not/Main.py b/projects/Odd or Even as Well as Prime or Not/Main.py new file mode 100644 index 000000000..0847c9374 --- /dev/null +++ b/projects/Odd or Even as Well as Prime or Not/Main.py @@ -0,0 +1,27 @@ + + +''' +Name: Prajwal Kedari +Country:India +GitHub: prajwalkedari , prajwal-kedari +Link: https://www.github.com/prajwalkedari/ +Source: Python-world +Thank!!! +''' + +num = int(input("Enter a number: ")) +if (num % 2) == 0: + Odd_or_even_result=f"{num} is Even as well as" +else: + Odd_or_even_result=f"{num} is Odd as well as" +if num > 1: + for i in range(2, int(num/2)+1): + if (num % i) == 0: + prime_or_not_result=" nor prime number" + break + else: + prime_or_not_result=" prime number" +else: + prime_or_not_result=" nor prime number" + +print(Odd_or_even_result,prime_or_not_result) diff --git a/projects/Odd or Even as Well as Prime or Not/README.md b/projects/Odd or Even as Well as Prime or Not/README.md new file mode 100644 index 000000000..37dd6442c --- /dev/null +++ b/projects/Odd or Even as Well as Prime or Not/README.md @@ -0,0 +1,37 @@ +# Odd or Even as Well as Prime or Not + +Simple Python program for check a number is an Odd or even as well as Prime or Nor prime +
+ +## Prerequisites +You only need Python3 to run this script. You can visit [here](https://www.python.org/downloads/) to download Python. + +
+ +## How to run the script +Running the script is really simple! Just open a terminal(cmd) in the folder where your script is located and run the following command : +```bash +python main.py +``` +
+ +## Sample use of the script + +``` bash +$python main.py +Enter a number : 5 +5 is a odd as well as Prime number + +$python main.py +Enter a number : 9 +9 is a odd as well as Nor-Prime number + +$python main.py +Enter a number : 6 +6 is a even as well as Nor-Prime number +``` +
+ +## Author +[@prajwalkedari](https://GitHub.com/prajwalkedari)
+ @prajwalkedari