Skip to content

Update 3_odd_even_numbers.py #62

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update 3_odd_even_numbers.py
I added another logic for odd numbers in the form of comments I hope I will be helpful to learners!
  • Loading branch information
NADIRHUSSAIN11 authored Oct 15, 2022
commit 4ffa62c99c83644159ec077cdd007ecb7e59917d
2 changes: 1 addition & 1 deletion data_structures/2_Arrays/Solution/3_odd_even_numbers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
odd_numbers = []

for i in range(1, max):
if i % 2 == 1:
if i % 2 == 1: # or i % 2 != 0:
odd_numbers.append(i)

print("Odd numbers: ", odd_numbers)