FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Update 3_odd_even_numbers.py by iayushbhartiya · Pull Request #52 · codebasics/data-structures-algorithms-python · GitHub

Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
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
@@ -1,7 +1,11 @@
max = int(input("Enter max number: "))

odd_numbers = []

#if number will be odd in that case it will omit the last number for that
if max % 2 == 0:
max = max
else:
max += 1
for i in range(1, max):
if i % 2 == 1:
odd_numbers.append(i)
Expand Down

Back | FazBrowse Home | New Git URL