We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6b8a495 commit bfde83cCopy full SHA for bfde83c
data_structures/2_Arrays/Solution/3_odd_even_numbers.py
@@ -1,7 +1,11 @@
1
max = int(input("Enter max number: "))
2
3
odd_numbers = []
4
-
+#if number will be odd in that case it will omit the last number for that
5
+if max % 2 == 0:
6
+ max = max
7
+else:
8
+ max += 1
9
for i in range(1, max):
10
if i % 2 == 1:
11
odd_numbers.append(i)
0 commit comments