Content-Length: 577 | pFad | http://github.com/codebasics/data-structures-algorithms-python/pull/52.diff

thub.com 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..7a9e237 100644 --- a/data_structures/2_Arrays/Solution/3_odd_even_numbers.py +++ b/data_structures/2_Arrays/Solution/3_odd_even_numbers.py @@ -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)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/codebasics/data-structures-algorithms-python/pull/52.diff

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy