forked from geekcomputers/Python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request geekcomputers#511 from nayaknameet/master
Fixes 3 files
- Loading branch information
Showing
3 changed files
with
40 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,8 +1,19 @@ | ||
# INPUT NUMBER OF EVEN NUMBERS | ||
def print_error_messages(): | ||
print("Invalid number, please enter a Non-negative number!") | ||
exit() | ||
|
||
|
||
try: | ||
n=int(input('Amount: ')) | ||
except ValueError: | ||
print_error_messages() | ||
|
||
n=int(input('Amount: ')) | ||
start=0 | ||
|
||
if n < 0: | ||
print_error_messages() | ||
|
||
for i in range(n): | ||
print(start) | ||
start+=2 |
This file contains 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 |
---|---|---|
@@ -1,8 +1,19 @@ | ||
# INPUT NUMBER OF ODD NUMBERS | ||
def print_error_messages(): | ||
print("Invalid number, please enter a Non-negative number!") | ||
exit() | ||
|
||
|
||
try: | ||
n=int(input('Amount: ')) | ||
except ValueError: | ||
print_error_messages() | ||
|
||
n=int(input('Amount: ')) | ||
start=1 | ||
|
||
if n < 0: | ||
print_error_messages() | ||
|
||
for i in range(n): | ||
print(start) | ||
start+=2 |