Answers for "create a function sq_cube which returns a list of lists containing both the square and the cube of only the even numbers in a given list."

0

create a function sq_cube which returns a list of lists containing both the square and the cube of only the even numbers in a given list.

def sq_cube(numbers):
    new_string = []
    numbers = [round(num) for num in numbers]
    for W in numbers:
      if W % 2 ==0:
        new_string.append([W**2,W**3])
        
    return new_string
Posted by: Guest on September-01-2021

Code answers related to "create a function sq_cube which returns a list of lists containing both the square and the cube of only the even numbers in a given list."

Python Answers by Framework

Browse Popular Code Answers by Language