This repository was archived by the owner on May 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Even or odd and Prime or nor-prime #558
Open
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1d10f6f
Even or Odd and Prime or not
prajwalkedari 61ee31e
Odd or even and prime or nor
prajwalkedari 2059e33
Updated main.py
prajwalkedari a42ac01
Change folder name
prajwalkedari 5446f0f
Create Odd or Even as Well as Prime or Not
prajwalkedari d976a83
.
prajwalkedari 0eb1d91
.
prajwalkedari cd47ccc
Rename
prajwalkedari a1d4108
Read me
prajwalkedari File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
projects/Odd or Even as Well as Prime or Not/Main.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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) |
37 changes: 37 additions & 0 deletions
projects/Odd or Even as Well as Prime or Not/README.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 | ||
| <Br> | ||
|
|
||
| ## Prerequisites | ||
| You only need Python3 to run this script. You can visit [here](https://www.python.org/downloads/) to download Python. | ||
|
|
||
| <Br> | ||
|
|
||
| ## 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 | ||
| ``` | ||
| <Br> | ||
|
|
||
| ## 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 | ||
| ``` | ||
| <Br> | ||
|
|
||
| ## Author | ||
| [@prajwalkedari](https://GitHub.com/prajwalkedari)<br> | ||
| @prajwalkedari |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.