Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Filter Odd Numbers | Automating Tasks with Python
Automating System Tasks with Python: A Beginner's Guide
Section 1. Chapter 8
single

single

bookChallenge: Filter Odd Numbers

Swipe to show menu

Task

Swipe to start coding

Write a script that filters and prints only the odd numbers from a given list.

  • Iterate through the numbers list.
  • Check if each element in the list is odd.
  • Collect all odd numbers into a new list.
  • Print the list of odd numbers.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 1. Chapter 8
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

some-alt