Answers for "python make a list of odd numbers"

1

python make a list of odd numbers

odd_list = []
for a in range(10):
    if a % 2 != 0:
        odd_list.append(a)

print(odd_list)
Posted by: Guest on April-19-2022
1

python make a list of odd numbers

odd_list = []
for a in range(1, 10, 2):
    odd_list.append(a)

print(odd_list)
Posted by: Guest on April-19-2022
-1

list comprehension odd numbers python

L=([i%2 for i in range(10)])
print(L)
Posted by: Guest on March-03-2021

Code answers related to "python make a list of odd numbers"

Python Answers by Framework

Browse Popular Code Answers by Language