id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

david.white@denison.edu cs112fall2015 > square
prev  |  next  |  chance

Write a function square(data) that takes a list of numbers named data, squares each number in data , and returns data. For example, when the parameter is [4, 2, 5], you return [16, 4, 25].


square([5, 45, 35, 11, 16, 35, 18, 2, 17]) → [25, 2025, 1225, 121, 256, 1225, 324, 4, 289]
square([26, 6, 22, 4, 4, 2, 40, 44, 6]) → [676, 36, 484, 16, 16, 4, 1600, 1936, 36]
square([37, 35, 42, 26, 37, 26, 35, 25, 6]) → [1369, 1225, 1764, 676, 1369, 676, 1225, 625, 36]

...Save, Compile, Run (ctrl-enter)

def square(data):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Copyright Nick Parlante 2017 - privacy