• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests
September 23, 2022 |880 Views
Python program to Print Odd Numbers in a List
  Share  1 Like
Description
Discussion

In this video, we will write a python program to find all odd numbers in a list.

Below is the list of approaches that we will cover in this video:

1. Program to find the odd numbers using Iterative.
2. Program to find the odd numbers using Recursion.

In an iterative solution, we will iterate the whole list with an "if condition" that if a number is not divided by 2 then print that number. 

Another method is using recursion, here we will pass 2 parameters to the function one is a list and another is incremented index value at every call. If the index will equal to the length of the list the program will exit otherwise it will check the odd number and print the odd number from the list.

Python program to print odd numbers in a list: https://www.geeksforgeeks.org/python-program-to-print-odd-numbers-in-a-list/

Read More