+ 6

[Challenge]Display all perfect squares

create a function which takes as parameters an integer and return an array of all perfect square less than number parameter eg. def perfSquares(number) arr_perfect=[] for x un 0...number ..... return arr_perfect p perSquares(10)#=>[1,4,9]

16th Dec 2017, 12:29 AM
LISANGOLA BONDJALI CHRISTIAN
LISANGOLA BONDJALI CHRISTIAN - avatar
4 Answers
+ 3
My try: https://code.sololearn.com/W5Dq6CZFtKX3/?ref=app Note: he said "perfect squares LESS than number parameter", meaning that if the input is "25", the output is "1, 4, 9, 16".
16th Dec 2017, 11:09 PM
Augustinas Lukauskas
Augustinas Lukauskas - avatar
+ 2
Why did someone downvote this challenge?
16th Dec 2017, 10:53 PM
Augustinas Lukauskas
Augustinas Lukauskas - avatar
17th Dec 2017, 4:03 PM
Al Toe