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

 

amgreyson@gmail.com > reflectAcrossX
prev  |  next  |  chance

Given the vertices of a triangle, return the vertices of its reflection across the X-axis. Input L1 is the list of x-coordinates, and input L2 is the list of corresponding y-coordinates. Return the result as a list containing two items: the list of x-coordinates followed by the list of corresponding y-coordinates for the reflected triangle.


reflectAcrossX([1, 3, 6], [5, 1, 2]) → [[1, 3, 6], [-5, -1, -2]]
reflectAcrossX([0, -7, 0], [0, 0, 7]) → [[0, -7, 0], [0, 0, -7]]
reflectAcrossX([-1, -3, -6], [-5, -1, -2]) → [[-1, -3, -6], [5, 1, 2]]

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

def reflectAcrossX(L1, L2):

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

Difficulty: 150 Post-solution available

Copyright Nick Parlante 2017 - privacy