Menu
Coddy logo textTech

Recap - Number Processor

Part of the Logic & Flow section of Coddy's Python journey — lesson 75 of 78.

challenge icon

Challenge

Easy

Create function named process_numbers that takes a list of numbers and processes them according to specific rules.

Requirements:

  • First filter out all negative numbers and zero
  • Then for the remaining positive numbers:
    • Double even numbers
    • Triple odd numbers

Use map() and filter() to solve the problem.

Try it yourself

def process_numbers(numbers):
    # Write your code below
    
    
    processed_numbers = 
    return list(processed_numbers)

All lessons in Logic & Flow