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)