–1 vote
I want to filter out any number that contains a odd digit in it, this should happen in a range of number.

e.g.

1-10 must give an output as follows:

2 4 6 8
Nov 19, 2018 in Python 1,995 views

## 2 answers to this question.

This code will work:

```scsv = ""
for i in range (1000,3001):
if i % 2 == 0:
if '1' not in str(i) and '3' not in str(i) and '5' not in str(i) and '7' not in str(i) and '9' not in str(i):
scsv = scsv+str(i)+" , "
print (scsv[:-3])```

This code is very basic but serves the purpose.

answered Nov 19, 2018 by Nabarupa
n = list(range(10))

b = list(filter(lambda i:i%2!=0,n))

print(b)
answered Oct 1, 2019 by Nomizo_Coders

## How to write a program that counts number of characters, number of words, number of repeated words and number of repeated characters in a text file using opps concept in python

Here's the logic. You have to add ...READ MORE

## How to calculate square root of a number in python?

calculate square root in python >>> import math ...READ MORE

## How to find exponent of a number in Python?

Yes you can do it using the ...READ MORE

## How to check if a float value(decimal number) is between range(0 to 10) in python

Hello,  A function that returns True for an integer number (int or ...READ MORE

## how can i randomly select items from a list?

You can also use the random library's ...READ MORE

+1 vote

## how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

## how do i use the enumerate function inside a list?

Enumerate() method adds a counter to an ...READ MORE

## How to set Colorbar Range in matplotlib using Python

You could scale your data to the ...READ MORE

+1 vote