Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

Challenge: Array of Squares

Sumit Rawal answered on May 23, 2023 Popularity 1/10 Helpfulness 1/10

Contents


More Related Answers

  • Challenge 1: Square Numbers and Return Their Sum
  • Challenge: Array of Integers
  • Solution Review: Array of Squares

  • Challenge: Array of Squares

    0

    Input

    Output

    Sample Input

    Sample Output

    Test Yourself

    Problem Statement

    You are given an Array of integers. The Array needs to be modified in such a way that it should contain the squares of the original values at the same index as the original values.

    For instance, if the element at index 0 is 5, after modification it should be 25.

    Input

    The input will be the array testArray which stores the array to be modified.

    testArray has already been declared for you.

    Output

    The output will be the modified testArray.

    Sample Input

    (1,2,3)

    Sample Output

    (1,4,9)

    Test Yourself

    Write your code in the given area. Try the exercise by yourself first, but if you get stuck, the solution has been provided. Good luck! 

    Popularity 1/10 Helpfulness 1/10 Language python
    Source: Grepper
    Tags: python
    Link to this answer
    Share Copy Link
    Contributed on May 23 2023
    Sumit Rawal
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.