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 334b53c..5be6560 100644 --- a/data_structures/2_Arrays/Solution/3_odd_even_numbers.py +++ b/data_structures/2_Arrays/Solution/3_odd_even_numbers.py @@ -1,9 +1,6 @@ max = int(input("Enter max number: ")) -odd_numbers = [] - -for i in range(max): - if i%2 == 1: - odd_numbers.append(i) - -print("Odd numbers: ",odd_numbers) +if max & 1 == 1: # if the max = 11 ; 11 & 1 it will give 1 then the remaining value is 1 which will lead to ODD Number else EVEN Number(also can use "and" otherthan "&") + print("ODD") +else: + print("EVEN")