# Python | print list after removing ODD numbers

Here, we are going to implement a **python program that will print the list after removing ODD numbers**.

Submitted by **IncludeHelp**, on August 06, 2018

**Given a list, and we have to print the list after removing the ODD numbers in Python.**

**Example:**

Input: list = [11, 22, 33, 44, 55] Output: list after removing ODD numbers list = [22, 44]

**Logic:**

- Traverse each number in the list by using for...in loop.
- Check the condition i.e. checks number is divisible by 2 or not – to check ODD, number must not be divisible by 2.
- If number is not divisible by 2 i.e. ODD number from the list, use list.remove() method.

**Program:**

# list with EVEN and ODD number list = [11, 22, 33, 44, 55] # print original list print "Original list:" print list # loop to traverse each element in the list # and, remove elements # which are ODD (not divisible by 2) for i in list: if(i%2 != 0): list.remove(i) # print list after removing ODD elements print "list after removing ODD numbers:" print list

**Output**

Original list: [11, 22, 33, 44, 55] list after removing ODD numbers: [22, 44]

TOP Interview Coding Problems/Challenges

- Run-length encoding (find/print frequency of letters in a string)
- Sort an array of 0's, 1's and 2's in linear time complexity
- Checking Anagrams (check whether two string is anagrams or not)
- Relative sorting algorithm
- Finding subarray with given sum
- Find the level in a binary tree with given sum K
- Check whether a Binary Tree is BST (Binary Search Tree) or not
- 1[0]1 Pattern Count
- Capitalize first and last letter of each word in a line
- Print vertical sum of a binary tree
- Print Boundary Sum of a Binary Tree
- Reverse a single linked list
- Greedy Strategy to solve major algorithm problems
- Job sequencing problem
- Root to leaf Path Sum
- Exit Point in a Matrix
- Find length of loop in a linked list
- Toppers of Class
- Print All Nodes that don't have Sibling
- Transform to Sum Tree
- Shortest Source to Destination Path

Comments and Discussions

**Ad:**
Are you a blogger? Join our Blogging forum.

Learn PCB Designing: PCB DESIGNING TUTORIAL