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 : create a function to filter out positive numbers from a list.
Function Name: filterpositives
Input:
numbers: a list of integers andor 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:
Example output:
Function : Even Number Transformer
Write a function that transforms even numbers in a list by multiplying them by a specified factor.
Function Name: transformevens 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:
Example output:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
