Challenge 1: Compute Square of a Number
Given a number implement a function to compute its square.
We'll cover the following
Problem Statement
Implement a function that takes a number testVariable
and returns the square of the number.
Try using the following mathematical identity to solve this problem. .
Remember to implement your solution recursively.
Input
A variable testVariable
that contains the input number
Output
The square of the input number
Sample Input
5
Sample Output
25
Try it Yourself
Try to attempt this challenge by yourself before moving on to the solution. Good luck!
def findSquare(targetNumber) :# Write your code herereturn None
In the next lesson, we have the solution review of this problem.