max = int(input("Enter max number: ")) odd_numbers = [] for i in range(1, max): if i % 2 == 1: odd_numbers.append(i) print("Odd numbers: ", odd_numbers) The loop is Executed 0(n) times we can reduce as 0(n/2)