Question: Problem 3 : Finish writing the following function to return a list containing all of the squares ( 1 , 4 , 9 dots )

Problem 3: Finish writing the following function to return a list containing all of the squares (1,4,9dots) from 1 to n???2.
(A) Explain
Format
Copy
21
@ 8 Answer that will be automatically graded below, ID: 79|~232|
In []: def squares(n): # Compute the squares of the numbers from 1 to n.
#Hint: make sure to return your list, don't print it!
# YOUR CODE HERE
raise NotImblementedError()
Test
In []:
# Check that squares returns the correct output for several inputs:
from nose.tools import assert_equal assert_equal(squares(1),[1])
 Problem 3: Finish writing the following function to return a list

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!