From 4ffa62c99c83644159ec077cdd007ecb7e59917d Mon Sep 17 00:00:00 2001 From: Nadir Hussain <89727973+NADIRHUSSAIN11@users.noreply.github.com> Date: Sat, 15 Oct 2022 21:50:11 +0500 Subject: [PATCH] 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! --- data_structures/2_Arrays/Solution/3_odd_even_numbers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data_structures/2_Arrays/Solution/3_odd_even_numbers.py b/data_structures/2_Arrays/Solution/3_odd_even_numbers.py index ec1c4b7..894d30d 100644 --- a/data_structures/2_Arrays/Solution/3_odd_even_numbers.py +++ b/data_structures/2_Arrays/Solution/3_odd_even_numbers.py @@ -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) pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy