Question: You are going to create two functions. Function 1 : create a function to filter out positive numbers from a list. Function 1 Name: filter

You are going to create two functions.
Function 1: create a function to filter out positive numbers from a list.
Function 1 Name: filter_positives
Input:
numbers: a list of integers and/or floats.
Output:
A new list containing only the positive numbers from the original list, maintaining their order.
Constraints:
If the input list is empty or contains no positive numbers, return an empty list.
Example input: 2,4,-1,0
Example output: 2,4
Function 2: Even Number Transformer
Write a function that transforms even numbers in a list by multiplying them by a specified factor.
Function 2 Name: transform_evens Input:
numbers: a list of integers.
factor: an integer to multiply even numbers by.
Output:
A new list where each even number from the original list is multiplied by factor, while odd numbers remain unchanged.
Example input: [2,3,4],5
Example output: 10,3,20
 You are going to create two functions. Function 1: create a

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!