Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a function find_odd_numbers( ) that takes one input parameter, numbers, which is of the type list and it contains a list of integers. Your

Write a function find_odd_numbers( ) that takes one input parameter, numbers, which is of the type list and it contains a list of integers. Your function will have to extract only odd integers from numbers and put them into a new_list named odd_num and return this new list.

For example: >>> print (find_odd_numbers([1,2,3,4,5,6,7,8,9,10]))

[1, 3, 5, 7, 9]

>>> print (find_odd_numbers([-1,-3,4,6,8,-11,11,10]))

[-1, -3, -11, 11]

>>> print (find_odd_numbers([1,1,1,1]))

[1, 1, 1, 1]

>>> print (find_odd_numbers([2,4,6,8,10]))

[ ]

Hint: Use append( ) to add new item to a list

Note: Using Python

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2019 Wurzburg Germany September 16 20 2019 Proceedings Part 2 Lnai 11907

Authors: Ulf Brefeld ,Elisa Fromont ,Andreas Hotho ,Arno Knobbe ,Marloes Maathuis ,Celine Robardet

1st Edition

3030461467, 978-3030461461

More Books

Students also viewed these Databases questions