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

 

konstans@stuy.edu > ReplaceNegative
prev  |  next  |  chance

ReplaceNegative(nums) will take a list of numbers, and modify it in the following way: All negative numbers are replaced with that number multiplied by -2. Return that modified list.


ReplaceNegative([0, 1, 2, 3, 4]) → [0, 1, 2, 3, 4]
ReplaceNegative([0, -1, -2, -3, -4]) → [0, 2, 4, 6, 8]
ReplaceNegative([8, 6, 7, 5, 3, 0, 9]) → [8, 6, 7, 5, 3, 0, 9]

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

def ReplaceNegative(nums):

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