Print odd numbers of given range in list

rng=int(input("enter range : ")
list[]
for i in range(1,rng+1):
if not i%2==0:
list.append(i)
print(list)

3 Likes

Keep practicing . keep it up

Try to take starting value of range as input also that will be best. It is also good :+1: keep practicing

1 Like

sure, i will. Thankyou

2 Likes

Keep it up and keep learning :+1:

1 Like