Created
August 10, 2020 10:21
-
-
Save imShakil/cc53f9be64e6279395d14362c4c5716b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def square_number(list_of_number): | |
""" | |
@param list_of_number: a given list of integer number | |
@return: list of square number | |
>>> square_number([1, 2, 3, 4]) | |
[1, 4, 9, 16] | |
>>> square_number([10, 20, 30]) | |
[100, 400, 900] | |
""" | |
return [num ** 2 for num in list_of_number] | |
if __name__ == '__main__': | |
import doctest | |
doctest.testmod() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment